16.20 - Meaning of Rank - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ SQL Functions, Expressions, and Predicates

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

RANK 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.