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
MDeveloperMDeveloper 

Too many query rows: 50001

hi,

 

i have make a apex class and try to run single query but when i run this class it showing me an error :

Too many query rows: 50001 

please help me

Best Answer chosen by Admin (Salesforce Developers) 
Satish_SFDCSatish_SFDC
Probably that query is fetching more than 50000 rows.
Can you limit the results by adding either some more where criteria or using a LIMIT 50000 statement in the soql.

Regards,
Satish Kumar

All Answers

Satish_SFDCSatish_SFDC
Probably that query is fetching more than 50000 rows.
Can you limit the results by adding either some more where criteria or using a LIMIT 50000 statement in the soql.

Regards,
Satish Kumar
This was selected as the best answer
MDeveloperMDeveloper

thanks Satish.