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

Teradata Vantageā„¢ - SQL Functions, Expressions, and Predicates

prodname
Advanced SQL Engine
Teradata Database
vrm_release
16.20
created_date
March 2019
category
Programming Reference
featnum
B035-1145-162K

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
      ...