PERCENT_RANK() OVER ...
All functions > WINDOW FUNCTION > PERCENT_RANK() OVER ...
Returns the relative rank of the current row: (rank - 1) / (total rows - 1).
Syntax
Diagram(
Sequence(
Terminal("PERCENT_RANK"),
Terminal("("),Terminal(")"),
Terminal("OVER"),
Terminal("("),
NonTerminal("over_clause"),
Terminal(")"),
)
)| Parameter | Type | Required | Description |
|---|---|---|---|
over_clause | OVER CLAUSE | Yes | OVER (PARTITION BY ... ORDER BY ... [FRAME ...]) |
Notes
- Returns a value between 0 and 1 inclusive
- First row in each partition always has PERCENT_RANK of 0
- Requires ORDER BY clause to determine ranking order
- PARTITION BY creates independent ranking groups