I have a table EmpDetails:
EmpDetails
DeptID EmpName Salary Engg Sam 1000 Engg Smith 2000 HR Denis 1500 HR
SELECT D.DeptID, E.EmpName, E.Salary FROM Employee E INNER JOIN Department D ON D.DeptId = E.DeptId WHERE E.Salary IN (SELECT MAX(Salary) FROM Employee);