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
Using PIVOT function in Teradata 16 it could look like this (assuming your types are in a table called mytypetable):
SELECT
*
FROM
mytable PIVOT (SUM("value") FOR "type" IN (SELECT "Type" FROM mytypetable)) AS Temp_pivot
ORDER BY
id
One drawback is that you cannot decide on the order of the columns though.