ROW_NUMBER()
Sequential row number in the partition
Result type
BIGINT
Syntax
ROW_NUMBER () OVER <window_name_or_spec>
Returns the sequential row number in the partition, where 1
is the first row in each of the partitions.
ROW_NUMBER()
Sequential row number in the partition
BIGINT
ROW_NUMBER () OVER <window_name_or_spec>
Returns the sequential row number in the partition, where 1
is the first row in each of the partitions.
ROW_NUMBER
Examplesselect
id,
salary,
row_number() over (order by salary)
from employee
order by salary;
id salary rank -- ------ ---- 3 8.00 1 4 9.00 2 1 10.00 3 5 10.00 4 2 12.00 5