Assigns sequential numbers to rows within a partition, starting from 1.
Category: window
Syntax:
Returns: Integer
Context Filtering: ✓ Yes
Parameters
This function takes no parameters. The row numbering is determined by the ORDER BY clause in the window specification.
Validation
- Minimum parameters: 0
- Maximum parameters: 0
Examples
Returns a sequential number for each row within the partition, starting from 1.
When used with an ORDER BY clause, assigns sequential numbers based on the specified ordering.
Result: 1, 2, 3, 4, 5, ...
Useful for adding row identifiers, pagination, or creating sequential numbering within groups.
Last modified on March 13, 2026