-- 非等值连接-- 案例:查询员工的工资级别SELECT salary, grade_levelFROM employees eJOIN job_grades gON e.salary BETWEEN g.lowest_sal AND g.highest_salORDER BY salary;-- 案例:查询每个工资级别的个数(>2),按照级别降序SELECT grade_level,COUNT(salary)FROM employees eJOIN job_grades gON e.salary BETWEEN g.lowest_sal AND g.highest_salGROUP BY grade_levelHAVING COUNT(salary)>10ORDER BY grade_level DESC;
07.2sql99语法-内连接-非等值连接——MySQL
未经允许不得转载:爱站程序员基地 » 07.2sql99语法-内连接-非等值连接——MySQL