Convert N number of rows to N number of Columns

Database
Visitor

Convert N number of rows to N number of Columns

Hi 

 

I have a scenario like converting n number of rows to columns and vice versa. Dont know the number of columns would be present in a row but all those need to be conver into multiple rows. Requesting to please help with the query for same.

 

I/P:- 

1 a b c .......

2 x y .....

3 m n o ....

 

o/p:- 

1 a

1 b 

1 c 

.......

Tags (1)
1 REPLY 1
Highlighted
Teradata Employee

Re: Convert N number of rows to N number of Columns

Hi Tddata,

 

Check for UNPIVOT in docs.teradata.com, syntax may differs depending on your version.