16.20 - Example: Using Concatenation to Create More Readable Results - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2020-03-25
dita:mapPath
xzf1512079057909.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
kby1472250656485

Literals, spaces, and the TITLE phrase can be included in the operation definition to format the result heading and improve readability.

For example, the following definition returns side titles, evenly spaced result strings, and a blank heading.

   SELECT ('Sex ' || sex ||', Marital Status ' || mstat)(TITLE ' ')
   FROM Employee ;
   
   Sex M, Marital Status S 
   Sex F, Marital Status M 
   Sex M, Marital Status M 
   Sex F, Marital Status M 
   Sex F, Marital Status M 
   Sex M, Marital Status M 
   Sex F, Marital Status W
      ...