Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: how to delete the duplicated rows from a table
On Tue, 11 Jul 2000 19:55:04 GMT, dbajjer_at_my-deja.com wrote:
>Hi, I am tring to select the duplicated rows from a table and delete
>them. Please advice how to do so. Thanks JJer
>
>
Delete from your_table
where rowid in (select min(rowid)
from your_table group by (whatever attributes determine a duplicate) having count(rowid) > 1);
The above will delete one of a pair of duplicates, if you might have more than triplicated (or more) records you could play around a bit to deal with it. Received on Tue Jul 11 2000 - 00:00:00 CDT