function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Supraja KallakuriSupraja Kallakuri 

Too many query rows - 50001.-Even after having 'LIMIT' in the SOQL

I have an aggregate function in my class

Public List<AggregateResult> getGroupedResults() {
      return  [SELECT SUM(MTD_Revenue_Combined__c)Total,  Owner.ManagerId  FROM Account WHERE Owner.ManagerId = '00500000006pSSm' AND MTD_Revenue_Combined__c != 0.00  GROUP BY Owner.ManagerId LIMIT 50000];
    }

IT still throws the 50000 Limit error. Any ideas would be helpful. Thanks!
Dushyant SonwarDushyant Sonwar
http://salesforce.stackexchange.com/questions/7439/soql-aggregate-query-limit
See this..
This will help you