Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need a query to select data from a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Need a query to select data from a table
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: 1439
Location: Bangalore,India

PostPosted: Wed Mar 12, 2008 1:21 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us