You need to sign in to do that
Don't have an account?
phoenix7788
Too many query rows: 50001
hi
I have a apex batch:
global Iterable<AggregateResult> start(Database.BatchableContext bc) {
AggregateResult[] sg= [SELECT Phone FROM Account WHERE Phone <> null GROUP BY Phone HAVING COUNT(Phone) >= 2];
return sg;
}
but it doesnt working.The error is:
09:39:03.0 (22546931)|SOQL_EXECUTE_BEGIN|[32]|Aggregations:0|SELECT Phone FRO Account WHERE Phone != NULL GROUP BY Phone HAVING COUNT(Phone) >= 2
09:39:03.0 (570162894)|SOQL_EXECUTE_END|[32]|Rows:44
09:39:03.0 (570212289)|EXCEPTION_THROWN|[32]|System.LimitException: Too many query rows: 50001
09:39:03.0 (570386384)|HEAP_ALLOCATE|[32]|Bytes:30
09:39:03.0 (570430741)|SYSTEM_MODE_EXIT|false 09:39:03.0 (570514055)|FATAL_ERROR|System.LimitException: Too many query rows: 50001
i dont know why the error is happen.
(there is no error by using Name field
× System.LimitException: Too many query rows: 50001
AggregateResult[] sg= [SELECT Phone FROM Account WHERE Phone <> null GROUP BY Phone HAVING COUNT(Phone) >= 2];
○ No error
AggregateResult[] sg= [SELECT Name FROM Account WHERE Name <> null GROUP BY Name HAVING COUNT(Name) >= 2];
)
Is there a way to solve this?
I have a apex batch:
global Iterable<AggregateResult> start(Database.BatchableContext bc) {
AggregateResult[] sg= [SELECT Phone FROM Account WHERE Phone <> null GROUP BY Phone HAVING COUNT(Phone) >= 2];
return sg;
}
but it doesnt working.The error is:
09:39:03.0 (22546931)|SOQL_EXECUTE_BEGIN|[32]|Aggregations:0|SELECT Phone FRO Account WHERE Phone != NULL GROUP BY Phone HAVING COUNT(Phone) >= 2
09:39:03.0 (570162894)|SOQL_EXECUTE_END|[32]|Rows:44
09:39:03.0 (570212289)|EXCEPTION_THROWN|[32]|System.LimitException: Too many query rows: 50001
09:39:03.0 (570386384)|HEAP_ALLOCATE|[32]|Bytes:30
09:39:03.0 (570430741)|SYSTEM_MODE_EXIT|false 09:39:03.0 (570514055)|FATAL_ERROR|System.LimitException: Too many query rows: 50001
i dont know why the error is happen.
(there is no error by using Name field
× System.LimitException: Too many query rows: 50001
AggregateResult[] sg= [SELECT Phone FROM Account WHERE Phone <> null GROUP BY Phone HAVING COUNT(Phone) >= 2];
○ No error
AggregateResult[] sg= [SELECT Name FROM Account WHERE Name <> null GROUP BY Name HAVING COUNT(Name) >= 2];
)
Is there a way to solve this?
Hope this helps you!
Best Regards,
Jyothsna