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: Duplicate records

Re: Duplicate records

From: <derf23456_at_my-deja.com>
Date: Fri, 26 Jan 2001 14:03:34 GMT
Message-ID: <94s03g$ltg$1@nnrp1.deja.com>

Isn't this only going to work where there are two (and only two) records that are duplicates? (It threre are 3 records the same, the min will only choose one record to delete, leaving two that are the same).

If I'm correct above, I think changing the 'where rowid in' to 'where rowid NOT in' would delete all the duplicates.

In article <94qcrp$c85$1_at_news8.svr.pol.co.uk>,   "Happy" <allan_at_livvy80.freeserve.co.uk> wrote:
> delete from table_name
> where rowid in
> (select min(rowid) from table_name
> group by col1, col2, coln
> having count(0) > 1)
>
> Cheers
> Allan
>
> "Screamer" <mflopes_at_bigfoot.com> wrote in message
> news:94q1l9$ejm$1_at_venus.telepac.pt...
> > Can someone post a piece of SQL that deletes duplicate records in a
 table,
> > please ?
> >
> >
>
>

Sent via Deja.com
http://www.deja.com/ Received on Fri Jan 26 2001 - 08:03:34 CST

Original text of this message

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