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

Need Query for this requirement


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

New User


Joined: 04 Apr 2006
Posts: 86
Location: Hyderabad

PostPosted: Fri Oct 13, 2006 4:30 pm
Reply with quote

Hi,

I have a table EMPTAB with columns empname and Dept.There are different depts.
I want to select the employees of those depts, in which there are more than 10 members.

plz suggest me the query
Back to top
View user's profile Send private message
paresh.ojha

New User


Joined: 21 Sep 2006
Posts: 17

PostPosted: Fri Oct 13, 2006 5:24 pm
Reply with quote

Mahi,
I think this will solve your purpose

Code:
SELECT EMPNAME
    FROM EMPTAB
    WHERE DEPT IN (SELECT DEPT
                                  FROM EMPTAB
                                  GROUP BY DEPT
                                   HAVING COUNT(DEPT) >=10)
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 Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top