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