You need to sign in to do that
Don't have an account?
RarLopz
BillingAddress does not support aggregate operator COUNT
How Can i get a list of Accounts that has the same BillingAddress?
I tried this and got the error 'Line: 2, Column: 34
HAVING count(BillingAddress)>1 ^ ERROR at Row:5:Column:49 field BillingAddress does not support aggregate operator COUNT'
Set <String>SameBillingAddress = new Set<String>();
for (AggregateResult aggregate : [Select count(Id),BillingAddress
From Account
Where BillingStreet!= null AND BillingState!=null AND BillingCity!= null AND BillingPostalCode!=Null
Group By BillingAddress
HAVING count(BillingAddress) > 1
] )
{
SameBillingAddress.add((String)aggregate.get('BillingAddress'));
}
for (Account acc : [
SELECT Name, BillingAddress
FROM Account
WHERE BillingAddress IN :SameBillingAddress
]){
system.debug(+ acc.BillingAddress);
}
I tried this and got the error 'Line: 2, Column: 34
HAVING count(BillingAddress)>1 ^ ERROR at Row:5:Column:49 field BillingAddress does not support aggregate operator COUNT'
Set <String>SameBillingAddress = new Set<String>();
for (AggregateResult aggregate : [Select count(Id),BillingAddress
From Account
Where BillingStreet!= null AND BillingState!=null AND BillingCity!= null AND BillingPostalCode!=Null
Group By BillingAddress
HAVING count(BillingAddress) > 1
] )
{
SameBillingAddress.add((String)aggregate.get('BillingAddress'));
}
for (Account acc : [
SELECT Name, BillingAddress
FROM Account
WHERE BillingAddress IN :SameBillingAddress
]){
system.debug(+ acc.BillingAddress);
}
Like below
All Answers
Like below
System.QueryException: Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch