RANK

Translation specification for the transformation of the RANK() function

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Description

RANK sorts a result set and identifies the numeric rank of each row in the result. The only argument for RANK is the sort column or columns, and the function returns an integer that represents the rank of each row in the result. (RANK in Teradata)

Teradata syntax

RANK ( sort_expression [ ASC | DESC ] [,...] )

Snowflake syntax

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

Sample Source Pattern

Setup data

Teradata

Snowflake

RANK() using ASC, DESC, and DEFAULT order

Teradata

Snowflake

Known Issues

No issues were found.

No related EWIs.

Last updated