The rownum principle is as follows:
1. Perform a query operation
2. Set the row num of the first row to 1
3. Row num of the resulting rows is compared to the condition, and if it does not match, the row is discarded and if it matches, the row is returned
4.oracle gets the next line, and then increases the rownum by 1
5. Return to step 3rd
From this principle can be known, select Rownum,name from emp where rownum > 5;
How to understand it?
RowNum is a sequence that is the order in which the Oracle database reads data from a data file or buffer.
It gets the first record then the rownum value is 1, the second one is 2, and so on.
Because when you use >, because the rownum of the first record from the buffer is 1, it does not conform to the >5 condition, so it is deleted, then the strip is removed,
But its rownum is still 1, deleted, and so on, then there is no data.
Introduction to rownum Principles in Oracle