学习时间:
2023年1月22日
题目描述:
题解分享:
# 作 者 : 繁 华 倾 夏
# 力扣(LeetCode):181. 超过经理收入的员工
# MySQL 数据库
# a.ManagerId =b.Id 等价是关键
# 方法一:两表连接查询
select a.name as 'Employee'
from Employee as a, Employee as b
where a.ManagerId = b.Id and a.Salary > b.Salary
# 方法二:两表嵌套查询
# select name as Employee
# from Employee as a
# where a.salary > (select salary from Employee as b where b.id = a.managerId);