17.00 - 17.05 - Example: Using an IN List that Contains Multiple Columns with a Compatible Data Type - Advanced SQL Engine - Teradata Database

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

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval

In this example, the Q101Sales column contains an INTEGER data type, and Q201Sales is a BYTEINT data type. Both the INTEGER and BYTEINT data types are compatible with each other.

SELECT * FROM star1p UNPIVOT (measure_value  FOR  yr_qtr_measure IN
(Q101Sales, Q201Sales)) Tmp;

country     state  yr_qtr_measure  measure_value
-------     -----  --------------  -------------
Canada        ON     Q201Sales               10
USA           CA     Q101Sales               30
USA           CA     Q201Sales               50
USA           NY     Q101Sales               45