leetcode 184

发布时间 2023-04-11 16:12:05作者: Carl_ZhangJH

部门工资最高的员工

 

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
)