Select a row in a table: (Understanding: RowNum is an Oracle system order is assigned the number of rows returned from a query)SELECT * FROM (select RowNum a,t.* from Testtab t) where a=2;Cannot be:SELECT * FROM (select rownum,t.* from Testtab t) where rownum=2 or select * from Testtab where rownum=2;Return multiple lines of records:SELECT * from Testtab where rownum<=10;Returns a segment of a record: (for example, 4-10 rows in a record table)SELECT * FROM (select RowNum no,testtab.* from Testtab where rownum<=10) where no>=4;Returns a conditional, sorted record of a segment:Select RowNum num1,tt.* from (select RowNum num,t.* from (select Ecodeinfo.* to Ecodeinfo where a=1 order by Ecode D ESC) t) TT where NUM>19 and rownum<20>Oracle is the first to extract records and then sorted, and Oracle's rownum is generated in the extraction record, which is preceded by the sort operation, so the subquery must be sorted first. Cannot be:SELECT * from Tsettab where rownum>10;Returns the last line of records:SELECT * FROM (select RowNum a,t.* to Testtab T) where a= (select COUNT (*) from testtab);Returns the last N row record:SELECT * FROM (select RowNum a,t.* from Testtab t) where a= (select COUNT (*)-n from Testtab);----------------SELECT * from Adminrole where rownum<=4 minus select * from Adminrole where rownum<2>SELECT * FROM (select RowNum row_id, b.* from (select A.* to sorttable a order by SortID) b) where row_id between 5 and 9 ;