View previous topic :: View next topic |
Author |
Message |
syam Beginner
Joined: 14 May 2006 Posts: 22 Topics: 7 Location: INDIA
|
Posted: Mon Nov 06, 2006 5:43 am Post subject: Select Duplicate Rows |
|
|
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 |
|
|
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Mon Nov 06, 2006 9:11 am Post subject: |
|
|
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 |
|
|
syam Beginner
Joined: 14 May 2006 Posts: 22 Topics: 7 Location: INDIA
|
Posted: Mon Nov 06, 2006 11:22 am Post subject: |
|
|
Thank you _________________ S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN |
|
Back to top |
|
|
|
|