###### 181. Employees Earning More Than Their Managers

The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.

+----+-------+--------+-----------+
| Id | Name  | Salary | ManagerId |
+----+-------+--------+-----------+
| 1  | Joe   | 70000  | 3         |
| 2  | Henry | 80000  | 4         |
| 3  | Sam   | 60000  | NULL      |
| 4  | Max   | 90000  | NULL      |
+----+-------+--------+-----------+


Given the Employee table, write a SQL query that finds out employees who earn more than their managers. For the above table, Joe is the only employee who earns more than his manager.

+----------+
| Employee |
+----------+
| Joe      |
+----------+

SELECT e1.Name AS Employee
FROM Employee e1,Employee e2
WHERE e1.Salary > e2.Salary
AND e1.ManagerId = e2.Id;

#### [LeetCode]Employees Earning More Than Their Managers,解题报告

2015-04-13 19:42:03

#### [Leetcode] [Database] Employees Earning More Than Their Managers解题笔记

2015-10-19 13:24:08

#### 181. Employees Earning More Than Their Managers(Lettcode)

2017-11-03 14:18:53

#### [leetcode] 181. Employees Earning More Than Their Managers

2016-07-21 10:09:16

#### Leetcode 181. Employees Earning More Than Their Managers

2016-09-01 01:34:29

#### 【LeetCode】181. Employees Earning More Than Their Managers

2017-09-23 19:27:26

#### 181. Employees Earning More Than Their Managers解题

2017-06-04 21:09:37

#### LeetCode:181. Employees Earning More Than Their Managers

2016-03-01 10:10:01

#### leetcode 181. Employees Earning More Than Their Managers

2016-05-10 21:48:46

#### LeetCode 181. Employees Earning More Than Their Managers

2017-08-10 20:44:34

## 不良信息举报

181. Employees Earning More Than Their Managers