>>>>>>>>>I have some dupe records that are causing me problems and
I need to delete one of the dupes for each record in several tables. Is there a way to do that without deleting each individual record by hand? Is there a way to do it using the command line?
>>
>>>>Ok, last try before I'll actually run a test :)
>>>>
>>>>select KeyID, count(*) as CntDups from yourtable group by KeyID ;
>>>> having CntDups > 1 ;
>>>> into cursor curDupes
>>>>if _tally>0
>>>> index on KeyID tag KeyID
>>>> scan
>>>> if seek(KeyID,'YourTable',"KeyID")
>>>> * select YourTable
>>>> delete in YourTable
>>>> endif
>>>> endscan
>>>>endif
>>>>use in curDupes
>>>>
>>>Looks like it'll work for one duplicate per KeyId. What if there're more than one?
>>
>>See the highlighted part in the original question :) What was asked - that was answered, nothing more, nothing less :)
>>
>>Of course, if we expand the original problem, I have to think a little bit more :)
>
>Ok, you got me :)
:) On the serious note, if we need to delete all dups but one, I think, Ron's solution is the perfect one and it's a standard for this kind of situation.
If it's not broken, fix it until it is.
My Blog