Example: Using a NAMED Phrase - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantage™

In the following SELECT statement, a NAMED phrase associates an arithmetic expression with the name “Projection” so that the calculated column can be more easily referenced in the WHERE clause and the heading (TITLE) in the report is more meaningful.

SELECT Name, ((Salary + (YrsExp * 200))/12) (NAMED Projection)
FROM Employee
WHERE DeptNo = 600 AND Projection < 2500;

The ANSI syntax for this example is the same as used for Example 2 for the AS.