Example: Using Concatenation to Create More Readable Results

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

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
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
      ...