>Sergey,
>Didn't do the tests. You might be right. Just thinking on SQL specification most of the time EXISTS sounds to be faster to me. Both subqueries might be called N times, however say subquery for IN is returning 1000 rows and the value compared is about the ends. Each time nearly 1000 rows should be checked. OTOH for EXISTS it's either a .T./.F. return. Subquery might still return 1000 rows but 1 or 1000 means .T. and returns immediately.
>Just my 0.02 cents.
Hi Cetin,
In reality, IN subquery runs only once and VFP can build index on it and use equivalent of SEEK() function to find if record is in that result set. The EXISTS subquery has to be run agains the real table for each record in the main query.
--sb--