select t.1* fromemp t1,(deptno,select max(sal) t2maxsal from emp group by deptno) t2where t1.deptno=t2.deptno and t1.sal=t2.t2maxsal;