Monday, May 9, 2011

Delete Duplicate Rows from a table

delete from dup1 d1
where rowid >
( select min(rowid) from dup1 d2 where d1.num = d2.num )

OR

delete from dup1 d1
where rowid  <
( select max(rowid) from dup1 d2 where d1.num = d2.num )

No comments:

Post a Comment