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)