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

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

Returns the rank (1 through n) of the rows in the group by the value of sort_expression list. The same sort_expression values have the same rank.

A rank r implies the existence of exactly r -1 rows with sort_expression value preceding it. Rows with the same sort_expression value have the same rank.

n rows with the same sort_expression values are assigned the same rank, r. The next distinct value gets 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.

ANSI Compliance

This statement is a Teradata extension to the ANSI SQL:2011 standard.

Type

Teradata-specific function.