Rank in Teradata

UDA
Enthusiast

Rank in Teradata

Hi everyone
I am new to teradata,
can some one explain me what is Rank() function in Teradata and what does it do

Thanks in advance
Tags (1)
4 REPLIES
Junior Contributor

Re: Rank in Teradata

It's a Standard SQL function, which is available in most DBMSes.

Just read the SQL Functions and Operators manual.

Dieter
Enthusiast

Re: Rank in Teradata

consider using row_number if you want to generate a unique rank for the data.
Enthusiast

Re: Rank in Teradata

The Ranking function permits a column to be ranked, either based on high or low order,
against other rows in the answer set. By default, the output will be sorted in descending
sequence of the ranking column, which correlates to descending rank.
The Rank function is defined as follows:
RANK(colname)
Where:
colname = the column to be ranked and the descending sort key of the result
Fan

Re: Rank in Teradata

Rank is the only function in teradata which gives the output in descending order.which is both teradata and ansi standard extension.
sel sal,rank(sal) from tablename......
if we need in ascending order then give asc....