Looks like this is a correct query. There also could be 2 more variations of it using LEFT JOIN and IS NULL and NOT EXISTS()
>Hello all
>
>We need to run a query to generate a list of any active table1.dbf records with table1.x1 fields that have data in the x1 fields with no matching x1 in the table2 table.
>
>I submitted the query should be
>
>SELECT d.userid, d.x1
> FROM table1 d
> WHERE d.active
> AND !EMPTY(d.x1)
> AND d.x1 NOT in (select x1 FROM table2) ORDER BY 2
>
>
>My co-worker says this is wrong.
>
>who is right?
>
>thanks
If it's not broken, fix it until it is.
My Blog