There is a scenario where I need to query the Account records that has the associated contacts >= 100, Since accounts and contact are not Master Detail relation ship I could not create roll-up summary.
I tried a similar query from stack exchange from the previous Question however that did not worked.
Select id,(Select Id from Contacts)From Account Where Id IN (Select Account from Contact Where Name !='')
Account
is not the name of a field on theContact
object, it should beAccountId
:Select id,(Select Id from Contacts)From Account Where Id IN (Select AccountId from Contact Where Name !='')