Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding ALL items not ANY
Message
De
11/10/2000 12:14:32
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00427146
Message ID:
00427894
Vues:
15
John,

Think of the subquery as returning a list of values and you are looking for a value in the list. It doesn't matter what it's called.
CREATE CURSOR Table1 (Ssn C(11))
CREATE CURSOR Table2 (Social C(11))

SELECT Ssn FROM Table1 ;
    WHERE Ssn IN (SELECT Social FROM Table2)
Is that what you needed to know?


>IOW, you can substitute other tables for OrdItems below as long as it includes the key OrdID.
> SELECT * FROM Orders ;
>>   INTO CURSOR Temp ;
>>  WHERE OrdID IN (SELECT OrdID FROM OrdItems O1 WHERE item = 'hammer') ;
>>    AND OrdID IN (SELECT OrdID From OrdItems O2 WHERE item = 'nails')
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform