RANK Function (ANSI) | Teradata Vantage - RANK (ANSI) - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantageā„¢

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

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

If n rows have the same value_expression values, then they are assigned the same rank, call it rank r. The next distinct value receives rank r +n. And so on.

Less formally, 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.

Type

ANSI SQL:2011 window function.