Three cases of Oracle Paging

Source: Internet
Author: User


In three cases of Oracle paging, there are three types of Oracle paging: www.2cto.com 1. rownumselect * from emp 2. show rownum [Oracle allocated] select a1. *, rownum rn from (select * from emp) a1; 3. 4. several query changes. to specify a query column, you only need to modify the subquery at the lowest layer. sort is also only need to modify the innermost can ------------------------------------------------------------ 1. select * from t-xiaoxi where ROWID in by rowid (select rid from (select rownum rn, rid from (select rowid, rid, cid fromt_xiaoxi order by cid desc) where rownum <10000) wherern> 9980) order by cid desc; execution time: 0.03 seconds 2. select * from (select t. *, row_number () over (order by ciddesc) 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 * fromt_xiaoxi order by cid desc) t where rownum <10000) wherern> 9980; the execution time is 0.1 seconds, where-t_xiaoxi indicates the table name, cid is the key field of the table. The 9981-9999 records are sorted by CId in descending order. The t_xiaoxi table contains more than 70000 records.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.