标签:工资 tween sele 案例 join 查询 结果 部门 ade
#案例:查询每个部门的平均工资的工资等级SELECT av.*,g.`grade_level`
FROM (
SELECT AVG(salary) ag,department_id
FROM employees
GROUP BY department_id
) av
INNER JOIN job_grades g
ON av.ag BETWEEN g.`lowest_sal` AND g.`highest_sal`;
标签:工资 tween sele 案例 join 查询 结果 部门 ade
原文地址:https://blog.51cto.com/14437184/2438395