The rownum pseudo-column in Oracle returns the row number of the currently selected row, starting from 1 and increasing sequentially. Its usage scenarios include: limiting the number of returned rows, obtaining row numbers, paging, and performing row-level operations. It should be noted that rownum is only applicable to SELECT queries and cannot be updated.
Use of rownum in oracle
What is rownum?
rownum in Oracle is a special pseudo column that returns the row number of the currently selected row. Line numbers start at 1 and increase sequentially on each line.
Syntax of rownum
SELECT ROW_NUMBER() OVER (ORDER BY column_name) AS rownum
Where:
rownum usage scenarios
rownum can be used in a variety of scenarios, including:
sqlSELECT * FROM table_name WHERE rownum <= 10;
Note
The above is the detailed content of What does rownum mean in oracle. For more information, please follow other related articles on the PHP Chinese website!