Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL join with empty data in one table
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00392660
Message ID:
00392696
Views:
9
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
Previous
Reply
Map
View

Click here to load this message in the networking platform