MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Select Duplicate Rows

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
syam
Beginner


Joined: 14 May 2006
Posts: 22
Topics: 7
Location: INDIA

PostPosted: Mon Nov 06, 2006 5:43 am    Post subject: Select Duplicate Rows Reply with quote

I want to fetch all the values from a table say EMP_DONATIONS where emp-id's are present EMP_ID column more than once. I mean to say I want all the emd-id's which are present more than once in the table
_________________
S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN
Back to top
View user's profile Send private message Visit poster's website
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Mon Nov 06, 2006 9:11 am    Post subject: Reply with quote

Code:

SELECT * FROM EMP_DONATIONS
WHERE EMP_ID IN (SELECT EMP_ID FROM EMP_DONATIONS
                             GROUP BY EMP_ID
                             HAVING COUNT(EMP_ID) > 1)
Back to top
View user's profile Send private message
syam
Beginner


Joined: 14 May 2006
Posts: 22
Topics: 7
Location: INDIA

PostPosted: Mon Nov 06, 2006 11:22 am    Post subject: Reply with quote

Thank you Smile
_________________
S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group