>select * from table1;
>where keyfield NOT IN;
>(select keyfield from table2)
>Any ideas for something faster?
I don't think I saw this option. Since the sub-query isn't optimizable, this might be faster if the records of table2 in table1 is a small percentage or the whole.
First pull the records from table2 that exist in table1. This should be fully optimized.
SELECT table2.keyfield;
FROM Table2 JOIN Table1
ON table2.keyfield-table1.keyfield;
INTO CURSOR temp
SELECT *
FROM table1
WHERE keyfield NOT IN;
(SELECT keyfield from temp)
hth