16.20 - Usage Notes for Examples - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Administration
Programming Reference
Publication ID
B035-1210-162K
Language
English (United States)
  • Columns in table T that are not included in any of the column lists are referred to as "copy columns," and are included in every row of the output.
  • Value column names and the UNPIVOT column name must not exist in table T.
  • The names in column_list_value must exist in table T.
  • The number of VALUE_COLUMNS must be equal to the number of columns in each column list. One column list defines which source columns get mapped to the value columns for one row of output.
  • Column alias list values are names that are used for the UNPIVOT_COLUMN to indicate which source column(s) data is in the value columns for that row.

    If specified, the number of alias names must be equal to the number of column lists.

    If not specified, column alias names default to the names of the columns in the column list, concatenated with an '_'.

  • The UNPIVOT_COLUMN is a VARCHAR(1000).
  • If INCLUDE_NULLS = 'yes', there will be exactly n rows of output for every row of input, where n is the number of column lists.

    If INCLUDE_NULLS = 'no', then there will be at most n rows of output for every row of input, where n is the number of column lists. Any row with NULLS for every value column is eliminated.