UNPIVOT Function Syntax | Teradata Vantage - 17.10 - UNPIVOT Function Syntax - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1145-171K
Language
English (United States)
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.