Example: Using AS to Assign a Temporary Name to an Expression - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

This syntax allows the ORDER BY clause to include column names rather than positionally defining the sort columns. The AS keyword is not included when column_2 is renamed to second_value.

SELECT COLUMN1 +100 AS first_value, column_2 second_value
FROM table_1
WHERE second_value > 100
ORDER BY first_value;