184. Department Highest Salary

问题描述

解决方案

select b.Name Department,a.Name Employee,a.Salary from
(
select  e1.Salary,e1.Name,e1.DepartmentId from Employee e1 
where e1.Salary=(select max(Salary) from Employee e2 where e1.DepartmentId=e2.DepartmentId)
) a,Department b

where a.DepartmentId=b.Id
posted @ 2016-08-11 12:23  弦断  阅读(142)  评论(0编辑  收藏  举报