1 select t1.empno, t1.ename, t1.deptno, t1.sal 2 from emp t1 3 inner join ( 4 select t2.deptno, max(sal) max_sal 5 from emp t2 6 group by t2.deptno ) ... ...
1 select t1.empno, t1.ename, t1.deptno, t1.sal 2 from emp t1 3 inner join ( 4 select t2.deptno, max(sal) max_sal 5 from emp t2 6 group by t2.deptno ) t3 8 on ( t1.deptno = t3.deptno and t1.sal = t3.max_sal ) 9 order by t1.sal