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)


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