41.超过经理收入的员工

表:Employee 

+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| id          | int     |
| name        | varchar |
| salary      | int     |
| managerId   | int     |
+-------------+---------+
Id是该表的主键。
该表的每一行都表示雇员的ID、姓名、工资和经理的ID。
 

编写一个SQL查询来查找收入比经理高的员工。

以 任意顺序 返回结果表。

# Write your MySQL query statement below
select a.name as Employee
from Employee as a join Employee as b
on a.managerId = b.id
where a.salary > b.salary

 

posted @ 2022-03-14 08:44  随遇而安==  阅读(30)  评论(0编辑  收藏  举报