How to find maximum of total salary of all departments using sql?

Use the following query to find maximum of total salary of all departments.

SELECT d.dept_id,SUM(salary) sumsal FROM emp e, dept d
WHERE E.DEPT_ID = D.DEPT_ID
GROUP BY d.dept_id
HAVING SUM(salary) IN (SELECT MAX(SUM(salary)) FROM emp e, dept d
WHERE E.DEPT_ID = D.DEPT_ID
GROUP BY d.dept_id)

Search