TD_UNPIVOT | SQL Operators & User-Defined Functions | Teradata Vantage - TD_UNPIVOT - 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™

Purpose

Transforms table columns into rows.

Syntax

[TD_SYSFNLIB.] TD_UNPIVOT (
  ON { tableName | ( query_expression ) }
  USING VALUE_COLUMNS ( 'value_columns_value' [,...] )
  UNPIVOT_COLUMN ( 'unpivot_column_value' )
  COLUMN_LIST ( 'column_list_value' [,...] )
  [ COLUMN_ALIAS_LIST ( 'column_alias_list_value' [,...] )
      INCLUDE_NULLS ( { 'No' | 'Yes' } )
  ]
)
TD_SYSFNLIB.
Name of the database where the function is located.
tableName
The name of the table with the input data for the function.
query_expression
The SELECT statement with input data for the function.
VALUE _COLUMNS
Specifies the destination column or columns for the unpivoted data.
UNPIVOT_COLUMN
Specifies the name of the output column identifying the unpivoted data in each row of the value column of columns.
COLUMN_LIST
Specifies the input column data for the unpivoting operation.
COLUMN_ALIAS_LIST
Specifies alternate names for the values in the unpivoted column.
INCLUDE_NULLS
Specifies whether or not to include nulls in the transformation. Valid values:
  • ‘Yes'
  • ‘No’ (default)