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;
posted @ 2021-03-02 11:12  Garrett_Wale  阅读(87)  评论(0编辑  收藏  举报