rank
ranking window function
Applies to: Databricks SQL Databricks Runtime
Returns the rank of a value compared to all values in the partition.
Returns
An INTEGER
.
The OVER
clause of the window function must include an ORDER BY clause.
Unlike the function dense_rank
, rank will produce gaps in the ranking sequence.
Unlike row_number
, rank does not break ties.
If the order is not unique, the duplicates share the same relative earlier position.