Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use select... where EXISTS ... ?
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00793069
Message ID:
00793101
Views:
33
Sergey,

>You can also rewrite it as follow (it may be faster)
>
SELECT taitem.ident;
>       FROM taitem;
>       WHERE code IN (SELECT arcode.code FROM arcode ;
>	                  WHERE arcode.activity = "EA")
>
I'm almost positive that an EXISTS select is going to be faster than an IN select. AFAIK exists allows the inner select to be run only once. IN forces it to be run for every row in the outer select.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform