>>>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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement