main logo
Subject: Re: SELECT-Sql IN clause help
Author: Peter Cushing
Posted: 2006/11/30 11:45:08
 
View Entire Thread
New Search


Alan Bourke wrote:
> I know this is simple but I\'m having a thick day.
>
> Two tables
>
> table1 (ref C(16))
>
> table2 (parent C(16), ref C(16))
>
> What\'s the VFP9 SELECT command to get the records out of table1 that do
> not have a matching record in table2, matching the ref fields.
>
> This works to get the ones that DO:
>
> select * from table1 where ref in (select ref from table2)
>
> but the opposite just returns one record, i.e.
>
> select * from table1 where ref not in (select ref from table2)
>
Can\'t see anything wrong with that Alan. I\'ve been using that syntax
for years and not noticed a problem. Maybe if they had different names
(E.g. ref1, ref2) it might make a difference.

Peter




 
©2006 Peter Cushing
<-- Prior Message New Search Next Message -->