Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> De-duping a table
Hi,
I'm looking for a simple way to de-dupe a table based on primary key (I don't mind which dupe gets deleted).
I've written some complex SQL which does an 8m row table in about 10 mins, but the following code which is much simpler disappears for hours.
There are only a few duplicates in the table.
delete from MY_TABLE
where ROWID not in (select min(ROWID)
from MY_TABLE group by MY_PRIMARY_KEY);
Any suggestions would be appreciated.
Regards,
Alan
Received on Sat Apr 07 2001 - 03:37:40 CDT
![]() |
![]() |