当前位置:网站首页>力扣(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;
边栏推荐
- MIT's latest paper, "the need for interpretable features: motivation and classification": building interpretability in the constituent elements of machine learning models
- Handling distributed transactions with powerful dbpack (PHP tutorial)
- 【MPC】①二次规划问题MATLAB求解器quadprog
- 使用强大的DBPack处理分布式事务(PHP使用教程)
- Valgrind usage of memory leak locating tool
- [.NET6]使用ML.NET+ONNX预训练模型整活B站经典《华强买瓜》
- SQLAchemy 常用操作
- CRC check
- 12. Gateway new generation gateway
- 技术分享 | Linkis参数介绍
猜你喜欢

The exclusive collection of China lunar exploration project is limited to sale!

Oracle和JSON的結合

12款大家都在用的產品管理平臺

Handling distributed transactions with powerful dbpack (PHP tutorial)

SQL optimization - in and not in, exist

. Net 5.0+ does not need to rely on third-party native implementation of scheduled tasks

Combinaison Oracle et json

Matplotlib数据可视化基础

新一代云原生数据库的设计与实践

What legal risks and qualifications should be paid attention to when building a digital collection platform?
随机推荐
LeetCode 438. 找到字符串中所有字母异位词__滑动窗口
银行卡借给别人是否构成犯罪
Half of 2022 has passed, isn't it sudden?
华为设备配置大型网络WLAN基本业务
How to get the maximum value of column two and regenerate the table when the SQL Server column one is the same
数字藏品新一轮热度开启
选择在中金证券上炒股开户可以吗?安全吗?
缺少比较器,运放来救场!(运放当做比较器电路记录)
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
The idea runs with an error command line is too long Shorten command line for...
dotnet 控制台 使用 Microsoft.Maui.Graphics 配合 Skia 进行绘图入门
Wireshark TS | confusion between fast retransmission and out of sequence
PHP有哪些优势和劣势
MIT最新论文《对可解释特征的需求:动机和分类》:在机器学习模型的组成元素中建立可解释性
[MPC] ② quadprog solves positive definite, semi positive definite and negative definite quadratic programming
Dotnet console uses microsoft Maui. Getting started with graphics and skia
数字藏品平台搭建需要注意哪些法律风险及资质?
Neurips 2022 | cell image segmentation competition officially launched!
Mutual conversion of pictures in fluent uint8list format and pictures in file format
Have the bosses ever done the operation of sink shunting and writing to Clickhouse or other databases.