Skip to content

Commit

Permalink
Update department-highest-salary.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 committed Jan 21, 2015
1 parent fa62b59 commit 34052c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MySQL/department-highest-salary.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# Write your MySQL query statement below
SELECT d.Department AS Department, e.Name AS Employee, d.Salary AS Salary
FROM (SELECT Department.Id AS DepartmentId, Department.Name AS Department, emp.Salary AS Salary
FROM Department JOIN (SELECT DepartmentId, MAX(Salary) AS Salary FROM Employee GROUP BY Employee.DepartmentId) emp
FROM Department JOIN (SELECT DepartmentId, MAX(Salary) AS Salary FROM Employee GROUP BY DepartmentId) emp
ON Department.Id = emp.DepartmentId) d
JOIN Employee e
ON e.DepartmentId = d.DepartmentId and e.Salary = d.Salary
Expand Down

0 comments on commit 34052c1

Please sign in to comment.