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

相关文章:

  • 2021-04-10
  • 2022-12-23
  • 2022-01-07
  • 2022-01-18
  • 2021-12-05
  • 2021-10-26
猜你喜欢
  • 2021-08-09
  • 2021-10-06
  • 2021-08-30
  • 2021-12-26
  • 2021-06-29
  • 2022-12-23
相关资源
相似解决方案