码迷,mamicode.com
首页 > 其他好文 > 详细

185. Department Top Three Salaries

时间:2018-12-22 11:42:09      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:esc   count   one   art   from   employee   rtm   sele   and   


SELECT d.Name AS Department,e.Name AS Employee,e.Salary AS Salary
FROM Employee e,Department d
WHERE 3>(SELECT COUNT(DISTINCT e1.Salary)
FROM Employee e1
WHERE e1.Salary > e.Salary
AND e1.DepartmentId = e.DepartmentId) AND e.DepartmentId = d.Id
ORDER BY d.Name,e.Salary DESC;

185. Department Top Three Salaries

标签:esc   count   one   art   from   employee   rtm   sele   and   

原文地址:https://www.cnblogs.com/yuesi/p/10159737.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!