Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Subselect
Message
From
21/04/2006 02:43:57
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01115214
Message ID:
01115246
Views:
8
>My example was off. But in my real SQL the Subselect returned some NULL vales. So I recoded the Subselect to have a WHERE field1 is not null and the "not in" worked.
>
>>The NOT IN is a part of WHERE clause
>>... WHERE table1.field1 NOT IN ...
>>>SELECT table1.field1
>>>FROM table1 NOT IN
>>>(SELECT DISTINCT table2.field1
>>>FROM table2);
>>>
>>>Why does the "NOT IN" not work?
>>>
>>>Brenda

uses
NOT EXISTS(SELECT*FROM table2 WHERE field1=table1.field1)
Previous
Reply
Map
View

Click here to load this message in the networking platform