I have a table EmpDetails:
EmpDetails
DeptID EmpName Salary Engg Sam 1000 Engg Smith 2000 HR Denis 1500 HR
If you just want to get the highest salary from that table, by department:
SELECT MAX(Salary) FROM TableName GROUP BY DeptID