Skip to main content
RANK

Assigns a rank to each row within a partition of the dataset, with ties receiving the same rank

Updated over 2 weeks ago

Description

The RANK() function assigns a rank to each row within a partition of the dataset, with ties receiving the same rank. This is useful for ranking data based on specified criteria.

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

Did this answer your question?