SELECT ag_dep.*,g.grade_level
FROM(SELECTAVG(salary),department_id
FROM employees
GROUPBY department_id
) ag_dep
INNERJOIN job_grades g
ON ag_dep.ag BETWEEN lowest_sal AND highest_sal;
from后面将子查询结果充当一张表,要求必须起别名#案例:查询每个部门的平均工资的工资等级#筛选条件平均工资between lowest_ sal and highest_ salSELECT ag_dep.*,g.grade_levelFROM ( SELECT AVG(salary),department_id FROM employees GROUP BY departmen...