Example: Using the TITLE Phrase in a SELECT Statement - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantageā„¢

When a title is specified at column creation time, note that the defined column name, not the title name, must be specified in statements that access the column. For example, to retrieve the total hours worked on each project by user Peterson, the project column must be referenced:

SELECT Proj_Id, SUM(Hours)
FROM CHARGES
WHERE EmpNo = 10001
GROUP BY Proj_Id ORDER BY Proj_Id ;

The returned report, however, uses the following title headings:

 Project
      Id     Sum(Hours)
--------     ----------
PAY-0001            9.5
PAY-0002           34.5

A TITLE phrase also can be given in the retrieval statement to override a default title.

For example, in the following SELECT statement, a TITLE phrase provides a more descriptive heading for the DOB column.

SELECT Name, DOB (TITLE 'Birthdate')
FROM Employee;

This statement returns:

Name         Birthdate
--------     ---------
Smith T       51/10/31
Newman P      56/08/29
Omura H       54/04/24
   .            .
   .            .

The multiline TITLE definition in this statement:

SELECT Name, DOB (TITLE 'Date//Of//Birth')
FROM Employee;

returns:

                Date
                  Of
Name           Birth
--------    --------
Smith T     51/10/31
Newman P    56/08/29
Omura H     54/04/24
   .           .
   .           .