Tuesday, 23 April 2013

Delete Duplicate Rows From A Table


1) DELETE FROM EMP E1
WHERE ROWID >(SELECT min(ROWID)
FROM EMP E2
WHERE E1.EMP_ID = E2.EMP_ID);

2) DELETE FROM EMP E1
WHERE E1.EMP_ID IN (SELECT E2.EMP_ID
FROM EMP E2
WHERE E1.EMP_ID = E2.EMP_ID
AND E1.ROWID > E2.ROWID);


Ur's
AmarAlam

1 comments:

Unknown said...
This comment has been removed by the author.

Post a Comment