1 概述
2 实现方式
2.1 无顺序
-- 注意值范围,rownum <= 5
select tt.*
from (select rownum rn,
t.*
from scott.emp t
where rownum <= 5) tt
where tt.rn >= 1;
2.2 有顺序
-- 三层嵌套,注意 rownum 位置,在第二层
select *
from (select rownum rn, tt.*
from (select t.*
from scott.emp t
order by t.hiredate) tt
where rownum <= 5) ttt
where ttt.rn >= 1;