今天爱分享给大家带来列出各个部门中工资高于本部门的平均工资的员工数和部门号,并按部门号排序.【面试题详解】,希望能够帮助到大家。
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 ;
原文链接:http://blog.itblood.com/3156.html,转载请注明出处。

![项目:S.P.E.S. v0.2汉化版 Project: S.P.E.S. [v0.2] [欧美SLG/汉化/动态]](/wp-content/uploads/replace/2025/07/18/428a0a075479321f67db4e2b940e0b1b.webp)