All Forums Database
barani_sachin 141 posts Joined 01/12
19 Feb 2012
Creating Dynamic columns...

Say i have data like this

 

 

COLUMN A

COLUMN B

A

1

A

2

A

3

A

4

B

1

C

1

C

2

 

And i want the output to be in the below format...

 

 

A

1

2

3

4

B

1

 

 

 

C

1

2

 

 

 

How can i achieve this??

ulrich 816 posts Joined 09/09
20 Feb 2012

start searching in the forum

http://forums.teradata.com/forum/database/transpose-rows-to-column#comment-19132

or in

www.teradataforum.com

there are other posts which are dealing with this.

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

ulrich 816 posts Joined 09/09
20 Feb 2012

P.S. real dynamic - in the meaning that you don't know how much columns will be needed before executing the query would require a dynamic SQL stored procedure...

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

You must sign in to leave a comment.