All Forums Database
rahulawasthi 2 posts Joined 01/15
21 Jan 2015
Transposing the columns

hello guys,
I want to transpose few rows into columns in teradata. please help me writing the SQL.
Input-- A
           B
           C
 
Output --  A   B  C
 
. i have tried a lot but counldn't find a solution.Please reply as soon as possible.
 

Raja_KT 1246 posts Joined 07/09
21 Jan 2015

Try with select tdstats.udfconcat(input1) from yourtable; You can remove the unwanted " and , using regexp_replace....

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

rahulawasthi 2 posts Joined 01/15
21 Jan 2015

I am not getting your point , i am new to teradata. Can you please explain more. thanks for the reply though.

Raja_KT 1246 posts Joined 07/09
22 Jan 2015

Maybe this example can help you:
http://forums.teradata.com/forum/analytics/merge-a-variable-number-of-rows-with-one-column-into-a-single-row-0#comment-135486

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

You must sign in to leave a comment.