Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding ALL items not ANY
Message
From
11/10/2000 12:14:32
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00427146
Message ID:
00427894
Views:
16
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')
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform