select rownum, ename from (select ename from scott.emp order by sal desc) where rownum between 1 and 2 orselect ename from scott.emp where sal = (select max(sal) from scott.emp) union select ename from scott.emp where sal = (select max(sal) from scott.emp where sal != (select max(sal) from scott.emp))
select * from (select * from emp order by sal desc nulls last )a where rownum<=2;
select * from emp a where ( select count(*) from emp where deptno = a.deptno and sal > a.sal) <=1 and a.deptno is not null;
orselect ename from scott.emp where sal = (select max(sal) from scott.emp)
union
select ename from scott.emp where sal = (select max(sal) from scott.emp where sal != (select max(sal) from scott.emp))
select *
from
(select *
from emp
order by sal desc nulls last
)a
where rownum<=2;
from emp a
where (
select count(*)
from emp
where deptno = a.deptno
and sal > a.sal) <=1
and a.deptno is not null;