181. 超过经理收入的员工 + join + MySql
181. 超过经理收入的员工
LeetCode_MySql_181
题目描述
方法一:笛卡尔积
# 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;
方法二:join方法
# Write your MySQL query statement below
select e1.Name as 'Employee'
from Employee e1 join Employee e2
on e1.ManagerId = e2.Id
and e1.Salary > e2.Salary;
Either Excellent or Rusty