题解:同一个表里的数据做比较筛选,思路大致是把一个表拆分为俩个表,根据需要的条件进行筛选。
SELECT
a.Name AS 'Employee'
FROM
Employee AS a,
Employee AS b
WHERE
a.ManagerId = b.Id
AND a.Salary > b.Salary
题解:同一个表里的数据做比较筛选,思路大致是把一个表拆分为俩个表,根据需要的条件进行筛选。
SELECT
a.Name AS 'Employee'
FROM
Employee AS a,
Employee AS b
WHERE
a.ManagerId = b.Id
AND a.Salary > b.Salary