Get Accounts with at least one closed-won opportunity in Salesforce

Salesforce SOQL query to get accounts with at least one closed won opportunity


Andres Canavesi
Jul 24, 2022
featured image
      
SELECT Id, Name,BillingCity, BillingState, BillingCountry, CreatedDate
FROM Account
WHERE Id IN (SELECT AccountId FROM Opportunity WHERE IsWon = true)
ORDER BY Name
LIMIT 10
      
    
Photo by Gwen Weustink on Unsplash