Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another Subquery Problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00053707
Message ID:
00053792
Views:
35
>>>Oh good grief I see what your saying. I went back to my job specification and it seems data definitions for each of my three tables was given to me wrong. Guess it was just too long of a day yesterday to see it with my own eyes :) Here's what I revised and have running now:
>>>
>>>SELE azactive.acct AS account, azactive.name FROM azactive ;
>>> WHERE NOT EXISTS( ;
>>> SELE * FROM addunit WHERE addunit.account==azactive.acct) ;
>>> INTO CURSOR temp1

Better:
SELECT azactive.acct AS account, azactive.name FROM azactive ;
WHERE azactive.acct NOT IN (SELECT addunit.account FROM addunit);
INTO CURSOR temp1

This one should be faster since the inner query doesn't depend on the outer one. So, hopefully, it is calculated just once.

>>>SELE azactive.acct AS account, azactive.name FROM azhandle, azactive ;
>>> WHERE NOT EXISTS( ;
>>> SELE * FROM azhandle WHERE azhandle.account==azactive.acct) ;
>>> INTO CURSOR temp2

Probably the same goes for this one if it's simetric to the first one (after you fix it:)).

I'm not very sure that these SELECTs will be faster. Please tell me if I was right. (I don't have now real big dbfs and on random generated tables is not the same.)

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform