PERCENT_RANK

functionsupportedCore SQL functions

docs.snowflake.com ↗

Window functions

Returns the relative rank of a value within a group of values, specified as a percentage ranging from 0.0 to 1.0.

Syntax

supportedpartialnot supportednot scored

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

Where

fixedRangeFrame ::=
    {
       RANGE UNBOUNDED PRECEDING
     | RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
     | RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING
    }

Usage notes