UNPIVOT [ { INCLUDE | EXCLUDE } NULLS ] (unpivot_spec)
[AS] derived_table_name [ (cname [,...] ) ]
Syntax Elements
-
unpivot_spec
-
{ cname FOR cname IN (cname_spec_1 [,...]) |
(cname [,...]) FOR cname IN (cname_spec_2 [,...] )
}
-
derived_table_name
- The table name specified for the resultant unpivoted table.
-
cname
- A column name.
For the UNPIVOT operation, column names within the Aggregate functions are referred to as measure columns, and column names in the FOR clause are referred to as pivot columns.
-
cname_spec_1
-
cname [ [AS] literal ]
-
cname_spec_2
-
(cname [,...]) [ [AS] literal ]
-
literal
- Any supported Teradata numeric, character or string literal.