Usage Notes for Examples - Advanced SQL Engine - Teradata Database

SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2023-04-27
dita:mapPath
qqu1556127655717.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1210
lifecycle
previous
Product Category
Teradata Vantage™
  • 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.