ORDER BY on two columns in Teradata

You can use order by for two or more columns.
The first column listed in the ORDER BY is the major sort key. Likewise, the last column listed is the most minor sort key within the sequence.
The minor keys are referred to as being sorted within the major sort key.

Example:
SEL last_name, class_code, grade_pt
FROM
tbl_emp
ORDER BY 2 DESC, 1;


Output:
Last_NameClass_CodeGrade_Pt
DelaneySR3.35
PhillipsSR3
SmithSO2
WilsonSO3.8
BondJR3.95
McRobertsJR1.9
HansonFR2.88
LarkinsFR0
ThomasFR4


Here, class_code is sorted desc first then the last name is sorted ascending within the class_code.