Oracle paging SQL statement 1. select * from t_xiaoxi where ROWID in (select rid from (select rownum rn, rid from (select rowid rid, cid fromt_xiaoxi order by cid desc) where rownum <10000) where rn> 9980) order by cid desc; execution time 0.03 seconds 2. 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 www.2cto.com
3. select * from (select t. *, rownum rn from (select * from t_xiaoxi order by cid desc) t where rownum <10000) wherern> 9980; execution time: 0.1 seconds, where t_xiaoxi is the table name, cid is the key field of the table, and records 9981-9999 are obtained after the CID is sorted in descending order. The t_xiaoxi table has more than 70000 records, and the personal feeling 1 is the best, followed by 3, 2. The worst author, mark_qi