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 All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts DB2 Query to get the count of Unique ... DB2 2
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 1
No new posts sort to find out the char which repea... Mainframe Interview Questions 10
No new posts Compare 2 alphabets in a REXX and fin... CLIST & REXX 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:


Back to Top