ROW_NUMBER

functionsupportedCore SQL functions

docs.snowflake.com ↗

Window function syntax and usage

Returns a unique row number for each row within a window partition. The row number starts at 1 and continues up sequentially.

Syntax

supportedpartialnot supportednot scored

ROW_NUMBER() OVER (
  [ PARTITION BY <expr1> [, <expr2> ... ] ]
  ORDER BY <expr3> [ , <expr4> ... ] [ { ASC | DESC } [ NULLS { FIRST | LAST } ] ]
  )

Usage notes