UNPIVOT Function Syntax | Teradata Vantage - UNPIVOT Function Syntax - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢
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.