題目鏈接:
181. Employees Earning More Than Their Managers
解析:
這是一道常見的類型題目,我們需要兩次使用Employee表泵三。
題解:
# Write your MySQL query statement below
SELECT E1.Name AS Employee FROM Employee E1 JOIN Employee E2
ON E1.ManagerId = E2.Id AND E1.Salary > E2.Salary;