AWS Documentation Amazon Redshift Database Developer Guide. Syntax Arguments Return type Examples. ROW_NUMBER window function. Determines the ordinal number of the current row within a group of rows, counting from 1, based on the ORDER BY expression in the OVER clause. If the optional PARTITION BY clause is present, the ordinal numbers are …
https://docs.aws.amazon.com/redshift/latest/dg/r_WF_ROW_NUMBER.html