MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Transpose

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
coolguy
Beginner


Joined: 01 Dec 2004
Posts: 82
Topics: 28

PostPosted: Tue Aug 04, 2009 7:49 am    Post subject: Transpose Reply with quote

Hi all

in db2 I want to write a SQL that can take the values from a Table which has multiple rows in it and want to convert them to as multiple columns.

For example the table data from table A is as follows


Input

A
B
C
D

Output should be display as

A B C D

Like this

Could you please help me in this

Thanks
Coolguy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Aug 04, 2009 12:32 pm    Post subject: Reply with quote

coolguy,

what happens if you have more than 750 rows? 750 columns is the max you can have per table.

IMHO I think a utility/pgm is best choice for this requirement

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolguy
Beginner


Joined: 01 Dec 2004
Posts: 82
Topics: 28

PostPosted: Wed Aug 05, 2009 1:20 am    Post subject: Reply with quote

Thanks Kolusu

But Number of rowes are limited 50 to 60 it is not going extend more then that, so that i am thinking to use SQL , Please guide me I am in the right Direction

Thanks
Cool
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Aug 05, 2009 9:38 am    Post subject: Reply with quote

coolguy,

You can follow the approach shown here given all your columns are numeric.

http://www.mvsforums.com/helpboards/viewtopic.php?t=5585&highlight=rows

At any rate , I think a program is best bet in this case.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolguy
Beginner


Joined: 01 Dec 2004
Posts: 82
Topics: 28

PostPosted: Thu Aug 06, 2009 5:42 am    Post subject: Reply with quote

Thanks Kolusu!!! Thanks for Your Time and Help
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group