[LeetCode-SQL]181. 超过经理收入的员工(SQL)自连接
1. 题目
2. 读题(需要重点注意的东西)
思路(自连接):
将Employee表复制出一份,比较两张表e1和e2
取出 e1.managerId = e2.id
且 e1中的salary > e2.salary
的行
3. 解法
---------------------------------------------------解法---------------------------------------------------
# Write your MySQL query statement below
select e1.name as Employee
from Employee e1, Employee e2
where e1.managerId = e2.id and e1.salary > e2.salary
可能存在的问题: