Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Delete Duplicate Records !!!!
Steve wrote:
> Hi, All:
>
> Can anybody tell me how to find all duplicate records and delete them in one
> coding? We have thousand of duplicate records needed to be deleted in
> one table (please don't ask why -- unquiue key issue).
>
> Apprecreciated.
>
> Steve
Via rowid. Approach can differ based on what records you want to preserve, but the idea is
delete from your_table where rowid in (
select rowid
from your_table x
where x.rowid > (
select min(y.rowid)
from your_table y
where y.uk_column1 = x.uk_column1
and y.uk_column2 = x.uk_column2
and ...)
)
--
Met vriendelijke groet/kind regards,
Frank van Bortel
Technical consultant Oracle
Work: Home: ---------------------------------- ---------------------------- V&L Informatica BV Hunzestraat 4 Palatijn 3, 7521 PN Enschede 7555 WB Hengelo PoBox 545, 7500 AM Enschede (31)074-2425046053-4341500 Received on Fri Oct 15 1999 - 14:43:42 CDT