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

SQL query to get the following result


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

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Thu Dec 18, 2008 10:38 pm
Reply with quote

I have a table having the below coloumns -

col1 col2
--------------------------------------------
A D
B H
B F
B G

I would like if someone can help me to write a sql query which can return the following output -

A D
B H, F, G

Can someone pls help me out in this?

Thanks a ton in advance.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Dec 18, 2008 11:08 pm
Reply with quote

Would there ever be more then three repetitions being returned?
Back to top
View user's profile Send private message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Thu Dec 18, 2008 11:13 pm
Reply with quote

No, Craq.

Maximum is 3 for distinct values of col2 for a particular col1.

Thanks for your time.
Back to top
View user's profile Send private message
sriraj1122

New User


Joined: 18 Dec 2008
Posts: 15
Location: Hyderabad

PostPosted: Tue Dec 30, 2008 4:56 pm
Reply with quote

I didnt get your result....

icon_rolleyes.gif

Could you xplain one more time ....!!!!!
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 RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts first column truncated in search result IBM Tools 13
Search our Forums:

Back to Top