select * from ( select t.deptno, t.name, t.sal+t.comm , dense_rank() over(partition by t.deptno order by t.sal+t.comm desc) rank from emp t ) s where s.rank<=2;
select * from ( select * from emp order by (sal+ comm) desc) where rownum < 3
select * from (select *,rownum rn from emp group by deptno order by (sal+ comm) desc) where rn<=2
(
select
t.deptno,
t.name,
t.sal+t.comm ,
dense_rank() over(partition by t.deptno order by t.sal+t.comm desc) rank
from
emp t
) s
where s.rank<=2;
select * from emp order by (sal+ comm)
desc) where rownum < 3
(select *,rownum rn from emp group by deptno order by (sal+ comm) desc)
where rn<=2