What's wrong with my query?


  • 0
    U

    SELECT B.Name as Department, A.Name as Employee, A.Salary as Salary FROM (SELECT * from Employee E WHERE Salary = (
    SELECT MAX(Salary) from Employee GROUP BY DepartmentId HAVING DepartmentId = E.DepartmentId)) A JOIN Department B ON A.DepartmentId = B.Id


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.