Parent Records With Only One Child Record In SOQL In Salesforce

SELECT AccountId, count(Id) FROM Contact GROUP BY AccountId HAVING count(Id) = 1

Leave a Comment

Your email address will not be published. Required fields are marked *