Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use select... where EXISTS ... ?
Message
De
28/05/2003 09:01:55
Walter Meester
HoogkarspelPays-Bas
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00793069
Message ID:
00793437
Vues:
27
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,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform