Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Need to convert Rows to columns - forum topic by praneethbobba9

$
0
0

 
Hi Guys
 
I'm facing a difficulty in achieving the below scenario
 
Scenario :
Table A is the table i'm having
( The column ID2 has only 4 distinct values -- A,B,C,D )
 
Table A
----------------|
ID1 ID2 Amt |
----------------|
1   A    45.00 |
2   B    66.00 |
2   A    33.00 |
3   C    34.00 |
3   A  100.00 |
4   D    10.00 |
4   B   101.00 |
-----------------|
 
I need to achieve this
___________________
ID    A     B      C         D  |
-------------------------------|
1   45                              |
2   33      66                    |
3   100             34           |
4           101             10   |
-------------------------------|
A,B,C,D will be my columns and the amt corresponding to the ID will be under respective column
 
Please help
 
Thanks in advance 
Praneeth.

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



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