ROW_NUMBER in Teradata

The ROW_NUMBER permits a column to be evaluated on high or low order, against all other rows to create the output set. The order will be sorted by default in descending sequence.

Example:
NAMESUB1SUB2SUB3
Ria455487
Robert454467
Joel854067
Roshan459467
Joldrine454497


SELECT
NAME
,SUM(SUB1 + SUB2 + SUB3) AS TOTAL_MARKS
,ROW_NUMBER() OVER (ORDER BY TOTAL_MARKS DESC ) AS STUDENT_ROWNUM
FROM STUDENT
GROUP BY 1;


NAMETOTAL_MARKSSTUDENT_ROWNUM
Roshan2061
Joel1922
Ria1863
Joldrine1864
Robert1565