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

please find the query


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

New User


Joined: 28 May 2005
Posts: 26
Location: Chennai

PostPosted: Sat May 28, 2005 11:27 am
Reply with quote

hello

table1 table2

eno ename eno training

112 ram 112 jcl
123 subbu 112 cobol
124 mad 124 db2
234 mental 123 java
123 cobol

write a query to select ename and eno from table1 those took trining any 2.
Back to top
View user's profile Send private message
kvivek

New User


Joined: 09 May 2005
Posts: 51
Location: Singapore

PostPosted: Sat May 28, 2005 12:58 pm
Reply with quote

SELECT * FROM TABLE1 WHERE ENO IN (SELECT ENO FROM TABLE2 GROUP BY ENO HAVING COUNT(*) >= 2);

Regards,
Vivek
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 To find whether record count are true... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top