Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT's Queries, which includes EXIST filter
Message
From
10/11/1997 18:46:20
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00059303
Message ID:
00059412
Views:
34
>>>As I know there is SELECT's filter using EXIST, which format is:
>>>SELECT <...> WHERE EXIST (subquery)
>>>
>>>How to use it? I have found very little information about it
>>>in VFP Help. I have tried it with 2 tables with diferent fields,
>>>but didn't work. :(
>>
>>SELECT SomeField FROM TableA WHERE ExtKey EXIST IN
>>(SELECT Key FROM TableB)
>Can you explain what do you mean by "ExtKey".
>
>For Example, I have 2 tables:
>Table1: T1.dbf
>Fields: L1 C(5), L2 N(2,0), L3 L
>and
>Table1: T2.dbf
>Fields: L1 C(5), L2 L
>
>and want to know which record from table T1 don't exists in table T2?

Since the L1 field is the only common field, I assume that if T1.L1 doesn't exist in T2, than we accept that the whole T1 record doesn't exist in T2:

SELECT * FROM T1 ;
WHERE T1.L1 NOT IN (SELECT L1 FROM T2)

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform