学习时间:
2023年2月23日
题目描述:



题解分享:
# 作 者 : 繁 华 倾 夏
# 力扣(LeetCode):184. 部门工资最高的员工
# MySQL 数据库
select
Department.name as 'Department',
Employee.name as 'Employee',
Salary
from
Employee
join
Department on Employee.DepartmentId = Department.Id
where
(Employee.DepartmentId, Salary) in
(select
DepartmentId, max(Salary)
from
Employee
group by DepartmentId
)

该文章是关于LeetCode第184题的解决方案,使用MySQL数据库查询每个部门工资最高的员工信息。通过连接Employee和Department表,结合子查询找到每个部门的最大薪资,从而得到结果。
7458

被折叠的 条评论
为什么被折叠?



