RANK

functionsupportedCore SQL functions

docs.snowflake.com ↗

Window functions

Returns the rank of a value within an ordered group of values. The rank value starts at 1 and continues up sequentially. If two values are the same, they have the same rank.

Syntax

supportedpartialnot supportednot scored

RANK() OVER ( [ PARTITION BY <expr1> ]
  ORDER BY <expr2> [ { ASC | DESC } ] [ NULLS { FIRST | LAST } ] [ <window_frame> ] )

Usage notes