• 0

    Admins. either learn SQL or improve your site.
    Can you spot what's wrong with this?

    # Write your MySQL query statement below
    SELECT d.Name AS Department,
           e.Name AS Employee,
           t1.Max_Salary AS Salary
      FROM (SELECT DepartmentID, MAX(Salary) AS Max_Salary
              FROM Employee
             GROUP BY DepartmentID) AS t1
      JOIN Department AS d ON t1.DepartmentID = d.ID
      JOIN Employee AS e ON t1.Max_Salary = e.Salary;

Log in to reply

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