RANK Function (ANSI) | VantageCloud Lake - RANK (ANSI) - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Returns an ordered ranking of rows based on the value_expression in the ORDER BY clause.

All rows with the same value_expression value are assigned the same rank.

n rows with the same value_expression values are assigned the same rank, r. The next distinct value gets rank r +n, and so on.

RANK sorts a result set and identifies the numeric rank of each row in the result. RANK returns an integer that represents the rank of each row in the result.

To use this function with time series data, see Teradata Vantage™ - Time Series Tables and Operations, B035-1208.

ANSI Compliance

This statement is ANSI SQL:2011 compliant, but includes non-ANSI Teradata extensions.

Type

ANSI SQL:2011 window function.