Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: HELP! How to identify and remove duplicate records
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
![]() |
![]() |