You need to sign in to do that
Don't have an account?

SOQL: How to find parent records with no associated child?
Is there a way to get a list of Account records (parent) with no child records associated (Opportunity) via SOQL?
I am trying to avoid doinf this in Apex, like getting the AccountId values from Opportunity and then query accounts where id not in this list.
Is it possible to get this list through SQOL?
Here is my query (I need only the accounts that have no associated Opportunity records):
SELECT a.Id, a.Name, (Select id from Opportunities) from Account a order by a.Name
Thanks,
Rodrigo
All Answers
There's an example about midway down this blog post. It also might help more in general to understand how relationship queries work on our platform.
http://blogs.developerforce.com/developer-relations/2013/05/basic-soql-relationship-queries.html
Select Id from Account where Rollup_Field__c = 0
https://www.begindot.com/review/phonexa/
https://www.techtricksworld.com/how-to-monetize-your-website/
https://techninjapro.com/phonexa-review-complete-marketing-solution/
Experience the fiercest territorial defense war in the Tower Defense (https://tower-defense.co)