Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Need to convert Rows to columns - response (2) by himuengg

$
0
0

A bit modified to get closer to the output shown by Praneet :-) . Although its based on Dieter's trick :-).
 

SEL ID1,

COALESCE((CASE WHEN ID2='A' THEN AMT END),'') AS A,

COALESCE((CASE WHEN ID2='B' THEN AMT END),'') AS B,

COALESCE((CASE WHEN ID2='C' THEN AMT END),'') AS C,

COALESCE((CASE WHEN ID2='D' THEN AMT END),'') AS D

FROM A

ORDER BY ID1


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>