Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00523261
Message ID:
00523377
Views:
18
>>John,
>>
>>This is the idea I got from Al Doman quite recently (search "Comparing two arrays" thread):
>>
>>You can do it this way:
>>pseudo-code
>>
  local lcUniqueTableName, lcGroupBy, i, lnFields
>>lcUniqueTableName=sys(2015) && could not remember this sys
>>select FreeTable
>>copy structure to (m.lcUniqueTableName)
>>select (m.lcUniqueTableName)
>>append from FreeTable
>>append from DBCTable
>>lcGroupBy=""
>>lnFields=fcount()
>>for i=1 to m.lnFields
>>    lcGroupBy=m.lcGroupBy+field(m.i)+iif(m.i=m.lnFields,'',',')
>>endif
>>
>>select *, count(*) as cntDups from (m.lcUniqueTableName) ;
>>   group by &lcGroupBy ;
>>   having cntDups>=2 ;
>>   into cursor curDups
>>
>>select *, count(*) as cntUnique from (m.lcUniqueTableName) ;
>>   group by &lcGroupBy ;
>>   having cntUnique=1 ;
>>   into cursor curUnique
>>
>>use in select(m.lcUniqueTableName)
>>delete file (m.lcUniqueTableName+".*")
>>
>>
>
>Nadya, that is the one I was thinking of, thanks!
>John

I can not guarantee the speed, though. Can you test other solutions too (that Brien gave you) and make benchmarking? BTW, I made few minor corrections in the code.

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform