• yeyed yeyed
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

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