Meaning of Rank

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

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

A rank r implies the existence of exactly r -1 rows with sort_expression value preceding it. All rows having the same sort_expression value are assigned the same rank.

For example, if n rows have the same sort_expression values, then they are assigned the same rank, call it rank r. The next distinct value receives rank r +n.

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