Write a SELECT to pull these duplicates and ONLY the duplicates.  Once you
are satisfied you are ONLY selecting the dups then change the query to a
DELETE.  Do yourself a favor a make a backup first.

Adrian


-----Original Message-----
From: cf kaizen [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 17, 2001 9:30 AM
To: CF-Talk
Subject: Comparing Records - Deleting Duplicates


I've got a table that has several records where key
fields are duplicate and I need to remove the
duplicate row (note the entire row is not duplicate).
What I know I have to do is run a query on the
recordset, sort by the fields in question, and compare
two records at a time. If the second record is a
duplicate, get rid of it, and continue (loop). I know
that there is a way to move forward one record from
the one selected, which would allow me to compare the
key fields and remove the second one if necessary, but
not sure how to go about it. Can anyone help?

Thanks in advance,

Andrew

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to