ORDER BY in Teradata

It performs sort operation.
The sort arranges the rows returned in ascending sequence unless you specifically request descending.
One or more columns may be used for the sort operation.

Syntax:
SELECT columnname
FROM tablename
ORDER BY columnname ASC | DESC


Example:
SELECT * FROM tbl_employee
ORDER BY emp_id;

The above code will display the records in ascending mode of employee number.

You can render ORDER BY with numbers like below.
SELECT id, name FROM tbl_employee
ORDER BY 1;

The above code will display the records in ascending mode of employee number.(first column)

Example:
emp_noname
22ww
11ee
33gg


Output:
emp_noname
11ee
22ww
33gg