HAVING使用子查询 HAVING使用子查询 //查询各部门平均工资,显示平均工资大于 //公司整体平均工资的记录 select deptno,avg(sal) from emp group by deptno having avg(sal)>(select avg(sal) from emp);