Example: Ordering on Column Name or Column Position Using an Ascending or Descending Sort Sequence - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantageā„¢

Each of the following statements can be used to list employees by department number, with the highest paid employee listed first and the lowest paid last:

     SELECT name, dept_no, salary
     FROM employee
     ORDER BY 2 ASC, 3 DESC;
     SELECT name, dept_no, salary
     FROM employee
     ORDER BY dept_no, salary DESC;