可以妙用 exists,select d.name Department,e.name Employee,e.Salary from Employee e join Department d on e.DepartmentId = d.Id where not exists(select * from Employee c where e.DepartmentId = c.DepartmentId and c.Salary > e.Salary) https://leetcode-cn.com/problems/department-highest-salary/