I have a table EmpDetails:
EmpDetails
DeptID EmpName Salary Engg Sam 1000 Engg Smith 2000 HR Denis 1500 HR
SELECT empname FROM empdetails WHERE salary IN(SELECT deptid max(salary) AS salary FROM empdetails group by deptid)