Leetcode no. 181 (sql)
来源:互联网 发布:3ds淘宝在哪买 编辑:程序博客网 时间:2024/04/26 05:48
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 E.namefrom Employee E, Employee Hwhere E.ManagerId= H.Id and E.Salary> H.Salary
0 0
- Leetcode no. 181 (sql)
- No SQL
- No SQL
- LeetCode No.11 ~No.12
- SQL ? No SQL?
- NO “NO SQL” (一)
- NO “NO SQL” (二)
- Leetcode NO.78 Subsets
- Leetcode NO.77 Combinations
- Leetcode NO.46 Permutations
- 【leetcode】No. 235 LCABST
- LeetCode no. 35
- Leetcode no. 37
- Leetcode no. 279
- Leetcode no. 335
- Leetcode no. 283
- Leetcode no. 40
- Leetcode no. 238
- 如何调整DOS窗口的宽高
- DB2的identity
- iOS面试题
- Android框架设计之-总结
- JAVA深入研究——Method的Invoke方法
- Leetcode no. 181 (sql)
- openmesh 将三维图像映射到圆盘
- 51nod1305 Pairwise Sum and Divide
- The C programing language 第三章课后题
- linux server安装nginx+mysql+php+apache+tomcat+java
- android系统的事件分发与消费机制
- Android ADB server didn't ACK * failed to start daemon * 简单有效的解决方案
- IE9对CSS3属性的支持情况
- HTTP响应头和请求头信息对照表