181. Employees Earning More Than Their Managers(SQL)
# Easy
# Write your MySQL query statement below
select e2.Name Employee
from Employee e1, Employee e2
where e1.Id = e2.ManagerId and e2.Salary > e1.Salary;
# 暴力解法,加上所有的限制条件# Write your MySQL query statement below
select e1.Name Employee
from Employee e1 join Employee e2 on e1.ManagerId = e2.Id
where e1.Salary > e2.Salary;
# join 方法这道题非常不好做,因为很容易晕掉用什么join和加上什么限制条件
Last updated
Was this helpful?