dense_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 rank ranking window function, dense_rank will not produce gaps in the ranking sequence. Unlike row_number ranking window function, dense_rank does not break ties. If the order is not unique the duplicates share the same relative later position.