Accomplish pivot in teradata sql

前端 未结 3 1245
滥情空心
滥情空心 2021-01-03 11:20

Say I have a query that returns values like this:

id    type     value
aaa   1a        10
aaa   1b        20
aaa   1c        7
bbb   2a        10
bbb   1a            


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-03 12:11

    There is a TD_UNPIVOT function which was added in TD 14.10 can be found in TD_SYSFNLIB.

    TD_UNPIVOT Function

    The PIVOT and UNPIVOT SQL commands were added in Teradata 16 and they can be found in the SQL Functions, Operators, Expressions, and Predicates manual. At this time, I can't find them in an online manual so you will need to download the PDF from Teradata.com.

    New TD 16 Features PIVOT and UNPIVOT

提交回复
热议问题