Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: how to delete the duplicated rows from a table

Re: how to delete the duplicated rows from a table

From: Peter L <news_at_abc.co.uk>
Date: 2000/07/11
Message-ID: <396b9083.11607957@news.freeserve.net>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US