本文主要是介绍185. 部门工资前三高的所有员工,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
185. 部门工资前三高的所有员工
题目链接:185. 部门工资前三高的所有员工
代码如下:
# Write your MySQL query statement below
select d.Name as 'Department',e1.Name as 'Employee',e1.Salary
from Employee as e1
join Department as d
on e1.DepartmentId=d.Id
where 3>(select count(distinct e2.Salary)from Employee e2where e2.Salary>e1.Salaryand e1.DepartmentId=e2.DepartmentId
)
这篇关于185. 部门工资前三高的所有员工的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!