1. According to rowID to divide
SELECT * from T_xiaoxi where rowID in (the Select Rid from (select RowNum rn,rid from, select rowID rid,cid from
T_xiaoxi ORDER BY cid Desc) where rownum<10000) where rn>9980) the ORDER by CID Desc;
Execution time 0.03 seconds
2. According to the analysis function to divide
SELECT * FROM (select T.*,row_number () over (order BY CID Desc) rk from T_xiaoxi T) where rk<10000 and rk>9980;
Execution time 1.01 seconds
3. Press RowNum to divide
SELECT * FROM (select T.*,rownum rn from (SELECT * from T_xiaoxi ORDER BY cid Desc) t where rownum<10000) where
rn>9980; Execution Time 0.1 sec.
Where T_xiaoxi is the table name, CID is the key field of the table, the 第9981-9999条 record is sorted by CID descending, and the T_xiaoxi table has more than 70,000 records.
Personal feeling 1 efficiency best, 3 times, 2 worst
Oracle Paging SQL statement three pagination technology