Write a solution to find employees who have the highest salary in each of the departments.
Return the result table in any order.
The result format is in the following example.
=
가 아니라 IN
을 써야한다.=
썼다가 계속 틀렸음SELECT D.name AS Department, E.name AS Employee, E.salary AS Salary
FROM Department AS D JOIN Employee AS E ON E.departmentId = D.id
WHERE (Salary, E.departmentId) IN
(
SELECT MAX(salary), departmentId FROM Employee
GROUP BY departmentId
)