I have a table EmpDetails:
EmpDetails
DeptID EmpName Salary Engg Sam 1000 Engg Smith 2000 HR Denis 1500 HR
As short as the question:
SELECT DeptID, MAX(Salary) FROM EmpDetails GROUP BY DeptID