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: Dave Godbey <luhbey_at_erols.com>
Date: Sun, 05 Nov 2000 23:57:03 -0500
Message-ID: <3A063A1E.B0F4C1D6@erols.com>

How about this...

declare -- Criteria for dups is criteria cursor c1 is select criteria,..., count(*) dupCount from someTable group by criteria,...;
begin
for c1_rec in c1 loop
delete from someTable where theCriteria=c1_rec.criteria and rownum<c1_rec.dupCount; -- Delete all but one. end loop;
end;

Ho wrote:

> How to identify and remove duplicate records using PL/SQL ?
>
> Many thanks for your help in advance.
Received on Sun Nov 05 2000 - 22:57:03 CST

Original text of this message

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