rownum是对结果集的编序排列,始终是从1开始,如果需要使用>会没有记录返回。可以采用一下两种方式使用,其实都是实例化.
select *
from (select rownum no,e.* from (select * from emp order by sal desc) e where rownum<=5 )
where no>=3;
select *
from (select rownum no,e.* from (select * from emp order by sal desc) e)
where no>=3 and no<=5;