本文主要是介绍184. 部门工资最高的员工,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
文章目录
- 题意
- 思路
- 代码
题意
题目链接
查出每个部门最高工资
思路
子查询+group by
代码
select b.name as Department,a.name as Employee,salary
from Employee as a
left joinDepartment as b
ona.departmentId = b.id
where(a.departmentId, salary) in(select departmentId, Max(salary)fromEmployeegroup by departmentId )
这篇关于184. 部门工资最高的员工的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!