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 

SQL question

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


Joined: 18 Jan 2003
Posts: 12
Topics: 7

PostPosted: Thu May 15, 2003 11:26 am    Post subject: SQL question Reply with quote

Hi,

I have data in DB2 table like this

CODE NAME NUM
------- ------------------------------ ----
60 TEST PROCESS 315
60 TEST PROCESS 316
60 TEST PROCESS 317

There is an unique index on code & num in this table. There will be multiple records on code and num cobmination. I want distinct code and
all the values in NUM column as a string.
I need a sql to retrieve the data as below

CODE NAME NUMS
----- ------ -------
60 TEST PROCESS 315,316,316

Can any one help me on this ?
Please let me know.

Thanks,
Ram.
Back to top
View user's profile Send private message
naren_ab
Beginner


Joined: 07 Jan 2003
Posts: 32
Topics: 10

PostPosted: Fri May 16, 2003 12:03 pm    Post subject: Reply with quote

Can you use a program ?
Back to top
View user's profile Send private message
YVRAMJ
Beginner


Joined: 18 Jan 2003
Posts: 12
Topics: 7

PostPosted: Fri May 16, 2003 3:33 pm    Post subject: Reply with quote

No,

I want to do it all in SQL itself. No host language.
Back to top
View user's profile Send private message
Glenn
Beginner


Joined: 23 Mar 2003
Posts: 56
Topics: 3

PostPosted: Fri May 16, 2003 5:17 pm    Post subject: Reply with quote

You could do it using SQL but it'd be a total nightmare all the way around. You should really consider doing it through a program. Basically doing what you want involves LOTS of self-joins (enough to fill out the horizontal list). Not a good idea.
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