the names of the fields were changed for representation purposes. one
is an identity field -- yes!
they are both (int) fields. since the one that is is certainly
unique...i can do my stuff off of that one.
querying and getting the whole thing...ordering by the other column that
has the duplicates gives
me pairs of matches...with that I can do a mod 2 calculation since its
basically every other row I have
to remove...
make sense?
....tony
r e v o l u t i o n w e b d e s i g n
[EMAIL PROTECTED]
www.revolutionwebdesign.com
its only looks good to those who can see bad as well
-anonymous
-----Original Message-----
From: Plunkett, Matt [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 5:20 PM
To: CF-Talk
Subject: RE: (SOLVED) sql question
Yeah I was a bit confused by that as well. If it works, great.
Otherwise, this is what I was suggesting, assuming that Id is the unique
key and reportId was the column with duplicates.:
<cfquery name="get" datasource="tableOne">
select distinct reportId, Id from
testReports where date = {ts '2004-02-11 00:00:00'}
order by reportId
</cfquery>
<cfset lastval = 0>
<cfloop query="get">
<cfif lastval IS reportID>
<cfquery datasource="tableOne">
delete from testReports where Id = #get.Id#
</cfquery>
</cfif>
<cfset lastval = reportID>
</cfloop>
-----Original Message-----
From: Paul Vernon [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 5:07 PM
To: CF-Talk
Subject: RE: (SOLVED) sql question
Tony,
I have a couple of questions about your solution...
1. As I read your code, I get the impression that ALL of your records
had a single duplicate record. Is that the case?
2. Did you add in the ID field as an extra field to help solve this
problem or was it already there and if it was there all along, is it an
auto incrementing numeric field or guaranteed to be unique in some other
way?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

