Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use select... where EXISTS ... ?
Message
From
28/05/2003 09:01:55
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00793069
Message ID:
00793437
Views:
28
David,

>That's not quite the same as what I posted either:

I See..

>
SELECT table1.* FROM Table1 ;
>   INNER JOIN Table2 ON table2.fk = table1.pk and Table2.Somefield = xSomeValue
I only replied to stress that JOINS cannot replace EXISTS in all cases. Your query is definately different from±
SELECT * FROM Table A ;
   WHERE EXISTS (SELECT * FROM Table2 B WHERE a.Pk = b.fk AND SomeField = xSomeValue)
Where both can return different results depending on the data.
Only the latter ensures that records of table1 occur only zero or ones in the resultset.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform