leetcode 184 部门工资最高的员工

部门工资最高的员工

 

select d.name as Department, e.name as Employee, e.salary as Salary from Employee e
left join Department d 
on e.departmentId = d.id
where (e.departmentId, e.salary) in 
(
    select departmentId, max(salary) from Employee
    group by departmentId
)

 

posted @ 2023-04-11 16:06  Carl_ZhangJH  阅读(14)  评论(0)    收藏  举报