Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Duplicate records
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