SELECT d.Name AS Department,e.Name AS Employee,e.Salary AS Salary
FROM Department d,Employee e,
(SELECT MAX(Salary) AS Salary,DepartmentId FROM Employee GROUP BY DepartmentId) m
WHERE d.Id = e.DepartmentId AND e.Salary = m.Salary AND e.DepartmentId = m.DepartmentId;
原文地址:https://www.cnblogs.com/yuesi/p/10159736.html
时间: 2024-10-08 20:49:05