transpose data

Tools & Utilities
Enthusiast

transpose data

Is it possible in teradata sql to transpose a row of data into a single field?

i.e.
row value
1 A
2 B
3 C
4 D
5 E

Into an output field…

Value
A,B,C,D,E

The number of possible rows is not fixed. It can be 1 or more.
3 REPLIES
Enthusiast

Re: transpose data

Look at how to pivot a table (in your case, rows to columns) in the answer from Dieter at:

http://www.teradata.com/teradataForum/shwmessage.aspx?forumid=10&messageid=1285
Enthusiast

Re: transpose data

Hi,

when i clicked, the above link is not displaying any message...

can you guys please post the answer for me.

Thanks,
Venkatesh
venkatesh.gubba@gmail.com
Enthusiast

Re: transpose data

We do that all the time with a WITH RECURSIVE query. The TD docs have a couple of pretty good examples.

R