|
Replying to my own posting, I just wanted to note two things. First, if there are potentially a large number of dupes in a set, this wouldn't be terribly efficient since it would only get rid of one in the set per query. Second, and I've advised David, I didn't put the > sign before the "From COLLECTION.TABLE" line, and that obviously shouldn't be part of the SQL statement. > -----Original Message----- > From: Metz, Zak > Sent: Friday, May 09, 2003 2:36 PM > To: Midrange Systems Technical Discussion > Subject: RE: Best Way to find duplicate records in same file > > > Then how about: > > Select KEYFIELD, COUNT(*), MAX(RRN(TABLE)) > >From COLLECTION.TABLE > Group by KEYFIELD > Having COUNT(*)>1 > > For each record in the result set, chain by RRN and delete. > Keep running > until result set is empty. NOTICE: This E-mail may contain confidential information. If you are not the addressee or the intended recipient please do not read this E-mail and please immediately delete this e-mail message and any attachments from your workstation or network mail system. If you are the addressee or the intended recipient and you save or print a copy of this E-mail, please place it in an appropriate file, depending on whether confidential information is contained in the message.
This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.