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

Home -> Community -> Usenet -> c.d.o.server -> Re: HELP! How to identify and remove duplicate records

Re: HELP! How to identify and remove duplicate records

From: <Haniff_at_cyberdude.com>
Date: Fri, 17 Nov 2000 00:17:40 GMT
Message-ID: <8v1tet$bcl$1@nnrp1.deja.com>

In article <8u266q$bo2$2_at_coco.singnet.com.sg>,   kowho_at_singnet.com.sg (Ho) wrote:
> How to identify and remove duplicate records using PL/SQL ?
>
> Many thanks for your help in advance.
>
>

Ok, I know it's been answered, but just for fun here's another way:

delete from mytable
where rowid not in (

   select max(rowid) dont_killme
   from mytable
   group by criteria1, criteria2,...,criteriaN )

[This picks the largest rowid from each set of duplicate records and leaves it un-deleted]

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Nov 16 2000 - 18:17:40 CST

Original text of this message

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