自定义每个部门最高薪水表,然后三个表连接查询
select d.Name as Department, e.Name as Employee, e.Salary as Salary
from Employee e, Department d ,
(select DepartmentId ,MAX(Salary) as Salary from Employee group by DepartmentId ) t
where e.DepartmentId=t.DepartmentId and e.Salary=t.Salary and d.Id=e.DepartmentId;