SELECT * FROM dept WHERE deptno=(SELECT deptno FROM (SELECT deptno FROM emp GROUP BY deptno ORDER BY AVG(sal) DESC) WHERE ROWNUM=1);