image_2022-01-17_13-11-06.png
21.8 KB
#medium
#N184. Department Highest Salary
problem link
#solution
#N184. Department Highest Salary
problem link
#solution
select d.name as 'Department', e.name as 'Employee',
e.salary as 'Salary' from employee e
join department d on e.departmentid = d.id
where (e.departmentid, e.salary) in
(select departmentid, max(salary)
from employee group by departmentid);