I have a table EmpDetails:
EmpDetails
DeptID EmpName Salary Engg Sam 1000 Engg Smith 2000 HR Denis 1500 HR
SELECT DeptID, Salary FROM EmpDetails GROUP BY DeptID ORDER BY Salary desc