Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT - SQL to list records NOT in another table.
Message
 
To
21/07/1999 21:08:47
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00244497
Message ID:
00244505
Views:
27
Nicholas,
Your code certainly looks OK. Here's a sample using real tables and fields. It worked fine, giving me the correct 5 records.
SELECT coid from coheader where coid NOT IN ;
  (SELECT cd_coid from codetail WHERE !cdid = cd_coid) ;
  into cursor atemp
The only thing I can think of is to put the code into a single string to see if you have an extra comma or missing semicolon.

Barbara

>I have two similar tables and would like to retrieve all records in the first that are NOT IN the second. In Foxpro 2.6 I used to write statements like:
>
> SELECT tb1_PK FROM table1 WHERE tb1_PK NOT IN ;
> (SELECT tb2_PK FROM table2 ;
> WHERE somecondition ) ;
> INTO CURSOR temp
>
>
>This style doesn't work in VFP 6.0. I have tried all kinds of combinations but I either get a syntax error or required object is missing.
>
>How do I specify this correctly?
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform