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

Teradata Vantage™ NewSQL Engine Release Summary

Teradata Database
Teradata Vantage NewSQL Engine
Release Number
March 2019
Content Type
Release Notes
Publication ID
English (United States)
Last Update

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.


  • 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.