Leetcode - 181. Employees Earning More Than Their Managers

문제

Loading...
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

정답

SELECT name AS Employee
FROM (
SELECT E1.name, E1.salary, E2.salary AS managerSalary
FROM Employee AS E1
LEFT JOIN Employee AS E2 ON E1.managerId = E2.id
) AS E
WHERE salary > managerSalary