Description | The |
Syntax | RANK() |
Output | integer |
Example
RANK() Over (Partition by Group
Order by Value
)
ID | Group | Value | RANK |
1 | A | 10 | 1 |
2 | A | 20 | 3 |
3 | A | 15 | 2 |
4 | B | 30 | 1 |
5 | B | 40 | 2 |
Assigns a rank to each row within a partition of the dataset, with ties receiving the same rank
Description | The |
Syntax | RANK() |
Output | integer |
RANK() Over (Partition by Group
Order by Value
)
ID | Group | Value | RANK |
1 | A | 10 | 1 |
2 | A | 20 | 3 |
3 | A | 15 | 2 |
4 | B | 30 | 1 |
5 | B | 40 | 2 |