Oracle分頁語句

2022-09-04 01:39:10 字數 386 閱讀 8998

select * from

(select a.*, rownum r

from

-- 這裡的sql可以改成你真正要執行的sql

(select * from articles

order by pubtime desc

) a--

-- 用上面的sql得回來的集合,使用rownum去比對,這樣rownum就會從這

個集合的第一筆資料開始往下計算,所以這邊是抓取前100筆

where rownum <= 100

) b

-- b集合總共有a集合和r(rownum)的資料,這裡是抓取大於第90筆的

where r > 90;

oracle 分頁語句

1.根據rowid來分 select from t xiaoxi where rowid in select rid from select rownum rn,rid from select rowid rid,cid from t xiaoxi order by cid desc where r...

oracle分頁語句

1.根據rowid來分 select from t xiaoxi where rowid in select rid from select rownum rn,rid from select rowid rid,cid from t xiaoxi order by cid desc where r...

Oracle分頁語句

select from select a.rownum rd from select from tablename where condition order by condition a where rownum endpage pagesize where rd startpage pagesi...