[Pugged] Duplicates

Dave J. Hala Jr. ciapug@ciapug.org
17 Dec 2002 07:27:10 -0600


Hmmm... Ah... I remember now.. the key thing found a duplicate when
doing an insert...  The problem is I have a bunch of records with
duplicate data already in the db....( I had to combine a bunch of
historical data from differant sources, [yuck!] )

I do have an auto increment key called "id".  I'm already using the
count function to find the duplicate fields. However, I think the
grouping clause maybe what I'm looking for...  I'll play with it some
this afternoon...

Thanks.



> > 
> > 
> > I seem to vaguely remember something in access that compared keys or
> > something. I remember it was a very, very simple thing that worked
> > really easily.
> > The pain of what I am doing is that I'm only looking for a match on any
> > one or more of a number of the fields in each record. I also need to
> > display the suspected duplicates so that someone can confirm it is
> > duplicate. Once it is confirmed, then it gets purged.
> > 
> > Anyone know of a better way?
> 
> 
> Can you select key1,key2,key3,count(*) GROUP BY key1,key2,key3??
> 
> You could make it even more elaborate, and add a HAVING clause to the 
> end, so it only selects where count > 1.
> 
> Better yet, add a unique index to the table so duplicates cannot be 
> inserted no matter what.
> 
> Tim
> 
> _______________________________________________
> Ciapug mailing list
> Ciapug@ciapug.org
> http://cialug.org/mailman/listinfo/ciapug
-- 

"...Unix, MS-DOS and Windows NT (also known as the Good, the Bad, and
the Ugly)"

OSIS
Dave J. Hala Jr.
641.485.1606