15.00 - Defining Headings and Summary Titles - Interactive Teradata Query Facility

Interactive Teradata Query User Guide

prodname
Interactive Teradata Query Facility
vrm_release
15.00
category
User Guide
featnum
B035-2452-034K

Defining Headings and Summary Titles

You may change the column headings of a result (originally defined when the table was created), as well as the titles of summary results, using the Teradata SQL TITLE phrase.

Use TITLE in your report statement to provide more meaningful headings for the Name and DeptNo columns and more descriptive titles for the department subtotals and the grand total:

SELECT DeptNo (TITLE ’Dept//Number’),
Name (TITLE ’Employee//Name’), Salary
FROM Employee
WHERE DeptNo IN (100, 700)
WITH SUM(Salary) (TITLE ’Dept Total’, FORMAT ’$$$$,$$9.99’)
BY DeptNo
WITH SUM(Salary) (TITLE ’Total***’, FORMAT ’$$$$,$$9.99’)
ORDER BY Name;

The TITLE phrase is enclosed in parentheses. If a FORMAT phrase is also used for column or summary data, TITLE may share the same set of parentheses. Apostrophes are used to delimit the title string. Also, note the use of a double slash (//) to break a title into separate lines.

Your result now looks like this (Figure 14):

Figure 14: Headings Example