leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

0184.sql (257B)


0 SELECT D.name AS Department,
1 E.name AS Employee,
2 E.salary
3 FROM Employee E
4 LEFT JOIN Department D
5 ON E.departmentId = D.id
6 WHERE (D.id, E.salary) IN (
7 SELECT departmentId, MAX(salary) AS salary
8 FROM Employee
9 GROUP BY departmentId
10 )