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
BRBR 

too many query rows: 50001

We have an object, which has 65000 records. We are doing a query with Group BY claues and using limit 50000, still we are getting error 'too many query rows: 50001'.

 

Any idea?

 

Thanks in advance!

r1985r1985

Can you post that query?

BRBR
SELECT Carrier_Name__r.name cname FROM Partner__c group by osstom__Carrier_Name__r.name limit 50000

 

 

This works fine if total records in the Partner object is less than 50000.

LakshmanLakshman

Hi Br,

You can write your query in batches. Can you please tell your needs?

 

-Lakshman

Shashikant SharmaShashikant Sharma

Is this the only query you are making in this context? What I mean is that are you querying something else as well except this one?

dkadordkador

The limit clause applies to the end result set size.  It's not going to limit the number of rows the query groups by.

 

Please post this as an improvement idea on the IdeaExchange.

BRBR

So how to limit 'number of rows the query groups by' ? Any workaround?

dkadordkador

As far as I know, not today.