I am using a SOQL aggregate query to sum various fields and group the results by business:
SELECT Name, SUM(IsAccepted) accepted, SUM(IsMember) member FROM Account WHERE CreatedDate = LAST_MONTH AND (IsAccepted = 1 OR IsMember = 1) GROUP BY Name
If I run this query in the Workbench application (or the Developer Console), I get a result back (pretty quickly) and yet if I use the query in a visualforce controller, I get a:
Too many query rows: 50001
How is Workbecnch and the Developer Console) able to return the query without error?