Reputation: 281
Is there any way to optimise this query to something quicker?
SELECT id FROM business
WHERE id NOT IN(SELECT business_id FROM business_community GROUP BY business_id)
Upvotes: 2
Views: 147
Reputation: 9864
Try this:
SELECT id FROM business AS b
LEFT JOIN business_community bc ON bc.business_id = b.id
WHERE bc.business_id IS NULL
Upvotes: 5