Concatenation Operator Examples | Teradata Vantage - 17.10 - 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
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1145-171K
Language
English (United States)

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