使用左连接,将员工和管理者连接在一起,选出员工薪资大于管理者的
SELECT
T1.Name as Employee
FROM Employee T1
LEFT JOIN Employee T2
on T1.ManagerId = T2.Id
where T1.ManagerId is not null and T1.Salary > T2.Salary
使用左连接,将员工和管理者连接在一起,选出员工薪资大于管理者的
SELECT
T1.Name as Employee
FROM Employee T1
LEFT JOIN Employee T2
on T1.ManagerId = T2.Id
where T1.ManagerId is not null and T1.Salary > T2.Salary