+ Start a Discussion
Deepu sfdcDeepu sfdc 

How to write a single SOQL to retrieve list of Accounts(Just Account Ids) which has more than 100 contacts associated to it ??

Best Answer chosen by Deepu sfdc
Naveen DhanarajNaveen Dhanaraj
Try this,
SELECT AccountId, count(Id) records FROM Contact GROUP BY Accountid HAVING count(Id) > 100