Example: Using an IN List that Contains Multiple Columns with a Compatible Data Type - 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ā„¢

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;

Result:

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