IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need a query to select data from a table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anilbhuvan

New User


Joined: 18 Nov 2006
Posts: 4
Location: hyderabad

PostPosted: Wed Mar 12, 2008 11:26 am
Reply with quote

I have a table of 8 columns and the first 7 columns data are same in every Row but 8th column data is different.

colm1 colm2 ......colm7 colm8
aa aa................ aa X
aa aa................ aa Y
aa aa................ aa z
aa aa................ aa A
aa aa................ aa B
aa aa................ aa C
aa aa................ aa D
aa aa................ aa E

Now i need to retrieve the data like : "aa aa ........ aa X, Y,Z,A,B,C,D,E"
including the commas

Can anyone give me the Query for this
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Mar 12, 2008 1:21 pm
Reply with quote

Anil,

Copy the table content into flat file and use sort utility to get the result.
Back to top
View user's profile Send private message
anilbhuvan

New User


Joined: 18 Nov 2006
Posts: 4
Location: hyderabad

PostPosted: Wed Mar 12, 2008 3:53 pm
Reply with quote

murmohk1,

I need a query to do that operation... i requirement is to have a query for that scenario
Back to top
View user's profile Send private message
MCEVOY

New User


Joined: 21 Nov 2005
Posts: 18

PostPosted: Wed Mar 12, 2008 4:48 pm
Reply with quote

QMF is great for this sort of thing, using the ACROSS function.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Mar 12, 2008 5:29 pm
Reply with quote

A simple query can not do what you are asking. SELECT statements combing multiple rows in multiple columns don't work like you want them to.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top