Select Duplicate Rows
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Database

#1: Select Duplicate Rows Author: syamLocation: INDIA PostPosted: Mon Nov 06, 2006 5:43 am
    —
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

#2:  Author: danm PostPosted: Mon Nov 06, 2006 9:11 am
    —
Code:

SELECT * FROM EMP_DONATIONS
WHERE EMP_ID IN (SELECT EMP_ID FROM EMP_DONATIONS
                             GROUP BY EMP_ID
                             HAVING COUNT(EMP_ID) > 1)

#3:  Author: syamLocation: INDIA PostPosted: Mon Nov 06, 2006 11:22 am
    —
Thank you Smile



MVSFORUMS.com -> Database


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group