Yes, that's what I'm looking for.
I will work tomorrow on it... :-))
>The simplest query would be SELECT yourfields FROM company LEFT JOIN sales ON ... WHERE price > 0 (just as you have it now) UNION SELECT yourfields FROM company WHERE company.id NOT IN (SELECT foreignkey FROM sales)
>
>However, NOT IN is not Rushmore optimizable. It might go faster if you break it into two queries: do your LEFT JOIN and leave out the WHERE condition, INTO CURSOR cursor1. Then SELECT * FROM cursor1 WHERE price > 0 UNION SELECT * FROM cursor1 WHERE ISNULL(price) or something like that. ISNULL() is optimizable.
Christian Isberner
Software Consultant