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.