超过经理收入的员工


sql 编程

https://leetcode-cn.com/problems/employees-earning-more-than-their-managers/

2. 解法

本质上就是内连接,然后算笛卡尔积之后过滤不符合的部分

# Write your MySQL query statement below
select
    e1.Name as Employee
from
    Employee e1
    inner join Employee e2 on e1.ManagerId = e2.Id
    and e1.Salary > e2.Salary

相关文章:

  • 2022-02-15
  • 2021-08-24
  • 2022-12-23
  • 2021-12-27
  • 2021-11-09
  • 2021-06-27
  • 2021-10-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-19
  • 2021-11-16
  • 2021-06-09
  • 2021-11-06
  • 2021-10-23
相关资源
相似解决方案