You need to sign in to do that
Don't have an account?

Writing a SOQL query
Hi,
Can u write a single SOQL to retrieve list of Accounts(Just Account Ids) which has more than 100 contacts associated to it. (Only one SOQL allowed)
Thanks in Advance
Can u write a single SOQL to retrieve list of Accounts(Just Account Ids) which has more than 100 contacts associated to it. (Only one SOQL allowed)
Thanks in Advance
I am afraid SOQL is not that sophisticated to have a aggregation sub query).
What you can have is a Rollup Count field in Account to find out the number of contacts under it (you may need a trigger to keep it upto date).
You can use this field to do your filtering.
Hope this helps.
Alternatively, you can query the contacts of each account in a soql and iterate to find it like this,