当前位置:网站首页>力扣(LeetCode)181. 超过经理收入的员工(2022.06.29)
力扣(LeetCode)181. 超过经理收入的员工(2022.06.29)
2022-07-01 10:56:00 【ChaoYue_miku】
表:Employee
±------------±--------+
| Column Name | Type |
±------------±--------+
| id | int |
| name | varchar |
| salary | int |
| managerId | int |
±------------±--------+
Id是该表的主键。
该表的每一行都表示雇员的ID、姓名、工资和经理的ID。
编写一个SQL查询来查找收入比经理高的员工。
以 任意顺序 返回结果表。
查询结果格式如下所示。
示例 1:
输入:
Employee 表:
±—±------±-------±----------+
| id | name | salary | managerId |
±—±------±-------±----------+
| 1 | Joe | 70000 | 3 |
| 2 | Henry | 80000 | 4 |
| 3 | Sam | 60000 | Null |
| 4 | Max | 90000 | Null |
±—±------±-------±----------+
输出:
±---------+
| Employee |
±---------+
| Joe |
±---------+
解释: Joe 是唯一挣得比经理多的雇员。
来源:力扣(LeetCode)
链接:https://leetcode.cn/problems/employees-earning-more-than-their-managers
MYSQL提交内容:
# Write your MySQL query statement below
SELECT
a.NAME AS Employee
FROM Employee AS a JOIN Employee AS b
ON a.ManagerId = b.Id
AND a.Salary > b.Salary;
边栏推荐
- sdp 协议中的packetization-mode方式和三种流传输模式
- CVPR 2022 | Virtual Correspondence: Humans as a Cue for Extreme-View Geometry
- NeurIPS 2022 | 细胞图像分割竞赛正式启动!
- 数据库实验报告(二)
- Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
- . Net 5.0+ does not need to rely on third-party native implementation of scheduled tasks
- Error: missing revert data in call exception
- Neurips 2022 | cell image segmentation competition officially launched!
- LeetCode 438. 找到字符串中所有字母异位词__滑动窗口
- A new round of popularity of digital collections opens
猜你喜欢
华为设备配置大型网络WLAN基本业务
Combinaison Oracle et json
价值1000毕业设计校园信息发布平台网站源码
Rising stars in Plant Sciences (rsps2022) final Science Lecture (6.30 pm)
CVPR 2022 | 基于密度与深度分解的自增强非成对图像去雾
Error: missing revert data in call exception
Database experiment report (I)
Simulink simulation circuit model of open loop buck buck buck chopper circuit based on MATLAB
BAIC bluevale: performance under pressure, extremely difficult period
2022年已经过去一半了,是不是很突然呢?
随机推荐
基于Matlab的开环Buck降压斩波电路Simulink仿真电路模型搭建
十年磨一剑:蚂蚁集团可观测性平台 AntMonitor 揭秘
Database experiment report (I)
Design and practice of new generation cloud native database
Detailed explanation of linear regression in machine learning
个人商城二开逍遥B2C商城系统源码-可商用版/拼团拼购优惠折扣秒杀源码
JS foundation -- data type
LeetCode. 515. Find the maximum value in each tree row___ BFS + DFS + BFS by layer
毕业季·进击的技术er
Wireshark TS | 快速重传和乱序之混淆
Error: missing revert data in call exception
[matytype] insert MathType inter line and intra line formulas in CSDN blog
Simulink simulation circuit model of open loop buck buck buck chopper circuit based on MATLAB
CRC check
数据库实验报告(二)
How does MySQL copy table data from one database to another (two databases are not linked to the same database)
想开个户,在网上开华泰证券的户安全吗?
LeetCode.每日一题 剑指 Offer II 091. 粉刷房子 (DP问题)
China's cellular Internet of things users have reached 1.59 billion, and are expected to surpass mobile phone users within this year
I'd like to know where I can open an account in Guangzhou? Is it safe to open an account online now?