Play Games

Search This Blog

Tuesday, June 7, 2022

Retrieve Accounts which have more contacts(more than 5 contacts) in salesforce - SalesforceGlobe4U

Get Accounts which have more contacts(more than 5 contacts) in salesforce - SalesforceGlobe4U

Solution: Use the SOQL query given below and change the value as needed in having clause.


SELECT Accountid, COUNT(Id)

FROM Contact

GROUP BY AccountId

HAVING COUNT(Id) > 5

Output:



No comments:

Post a Comment