The fastest paging speed in Oracle --- SQL statement explanation

Source: Internet
Author: User
RowidSQL statement interpretation select * frommytable2s1whererowidin (selectridfrom (selectrownumr1, ridfrom (selectrowidrid

Rowid SQL statement interpretation select * from mytable2 s1 where rowid in (select rid from (select rownum r1, rid from (select rowid rid

Homepage → Database Technology

Background:

Read News

The fastest paging speed in Oracle --- SQL statement explanation

[Date: 2011-12-19] Source: Linux Author: n52376531 [Font:]

Rowid SQL statement explanation

Select * from mytable2 s1 where rowid in (select rid from (select rownum r1, rid from (select rowid rid from mytable2) where rownum <= 10) where r1> = 3 );

Select rowid rid from mytable2 indicates using rowid to identify mytable2 (rowid is an Oracle System Function)

Select rownum r1, rid from (select rowid rid from mytable2) where rownum <= 10 indicates adding the rownum field (rownum is an oracle system function). The table found in the previous step is used as an embedded table.

Rownum <= 10 indicates the first 10 records to be queried.

Select rid from (select rownum r1, rid from (select rowid rid from mytable2) where rownum <= 10) where r1> = 1) rownum> = 3 returns the rowid Value

Rownum> = 3 indicates that the first 10 records not including the first 3 Records

Where rowid in indicates that the rowid result queried in the subquery matches the rowid in mytable2.

  • 0
  • JDBC + Oracle paging Query

    MySQL stored procedure and Java stored procedure call

    Oracle Basics

    Image Information

    View All comments in this article (0)

    Comments

    Latest Information

    Popular this week

    Introduction to Linux community-advertisement service-website map-help Info-contact us
    The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.


    Copyright©2006-2011 Linux community All rights reserved Zhejiang ICP backup No. 06018118

    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.