Reference material for PERCENT_RANK window function
( rank - 1 ) / ( rows - 1 )
where rank is the current row’s rank within the partition, and rows is the number of rows in the partition. PERCENT_RANK always returns values from 0 to 1 inclusive. The first row in any set has a PERCENT_RANK
of 0.
Parameter | Description | Supported input types |
---|---|---|
Parameter | Description | |
<partition_by> | An expression used for the partition by clause. | Any |
<order_by> | An expression used for the order by clause. | Any |
DOUBLE PRECISION
This function respects NULL
values, and results will be ordered with default null ordering NULLS LAST
unless otherwise specified in the ORDER BY
clause.
nickname | current_score | percent_rank |
---|---|---|
kennethpark | 90 | 0 |
sabrina21 | 85 | 0.2 |
rileyjon | 80 | 0.4 |
ymatthews | 79 | 0.6 |