-- 不能對(duì)ROWNUM使用>(大于1的數(shù)值)、>=(大于或等于1的數(shù)值)、=(大于或等于1的數(shù)值),否則無(wú)結(jié)果
-- 所以直接用只能從1開(kāi)始
-- rownum >10 沒(méi)有記錄,因?yàn)榈谝粭l不滿足去掉的話,第二條的rownum又成了1,所以永遠(yuǎn)沒(méi)有滿足條件的記錄。
select * from student where rownum>=1;
--如果想要用rownum不從1開(kāi)始,需按下面方法使用
select a1.* from (select student.*,rownum rn from student) a1 where rn >5;
--分頁(yè)查詢一
select * from (select a1.*,rownum rn from (select * from student) a1 where rownum =5) where rn>=2;
--分頁(yè)查詢二
select a1.* from (select student.*,rownum rn from student where rownum =5) a1 where rn >=3;
--分頁(yè)查詢?nèi)?
select a1.* from (select student.*,rownum rn from student) a1 where rn between 3 and 5;
以上所述是小編給大家介紹的Oracle數(shù)據(jù)庫(kù)分頁(yè)的集中方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!