TD_UNPIVOT and UNPIVOT Query as a Source to PIVOT - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ NewSQL Engine Release Summary

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
hqm1512077988481.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
B035-1098
lifecycle
previous
Product Category
Software
Teradata Vantage

The PIVOT function supports the UNPIVOT syntax or TD_UNPIVOT function as a source for the PIVOT operator.

The PIVOT/ UNPIVOT operator is a single dimensional way of interchanging the data, such as converting rows to columns or columns to rows.

You can also swap both the rows and columns within a single query; for example, using UNPIVOT as the source query to PIVOT. This allows for more flexibility for two-dimensional methods of interchanging data in a table.

Benefits

  • Allows you to change table data two-dimensionally.
  • You do not need to know the number of columns returned by UNPIVOT operator to use as PIVOT source.

Additional Information

For more information, see "PIVOT" in Teradata Vantageā„¢ SQL Functions, Expressions, and Predicates, B035-1145.