Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using IN and NOT IN clause for SQL in ODBC
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00788819
Message ID:
00788869
Views:
18
>when I run sqlexec to pull data down from one table based on if it exsits in another table that is filtered, it work great. HOwever, if i want to see data in the table that doesn't exsists in the other table that is filtered, ODBC doesn't seem to know how to handle it.
>
>This select statement sent to ODBC work ok
>SELECT iPK FROM Table1 WHERE iPK IN (SELECT iPK FROM Table2 WHERE cStatus IN ('A','B'))
>
>This select doesn't
>SELECT iPK FROM Table1 WHERE iPK NOT IN (SELECT iPK FROM Table2 WHERE cStatus IN ('A','B'))
>
>
>my examples tables contain about 600,000 (table1) and 3,000,000 (table2) records.
>

Hi Mark,

It would be helpfull to know what exactly doesn't work. Do you get an error or result isn't what you expected or something else?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform