今天爱分享给大家带来列出各个部门中工资高于本部门的平均工资的员工数和部门号,并按部门号排序.【面试题详解】,希望能够帮助到大家。
select a.ename,a.salary,a.deptid from emp a, (select deptd,avg(salary) avgsal from emp group by deptid ) b where a.deptid=b.deptid and a.salary>b.avgsal ;
原文链接:https://blog.itblood.com/3156.html,转载请注明出处。