How to count the child records for each parent record in Salesforce?

Sample SOQL:

SELECT AccountId, COUNT(Id) ContactCount FROM Contact GROUP BY AccountId

Output:


No comments:

Post a Comment