I have a custom object called equipment___c with more than 100.000 records, and also related to product object. To get product codes that are in equipment object, i used the following query:
select product.productCode from Equipment__c
Here i'm getting 100000 records as a result.(checked this from dataloader). one productcode can be assigned to multiple equipments... So when i ran this query there will be repeated product codes. But i want distinct product codes.. so that i can display those codes in VF page.
when i'm using the above SOQL query in controller, i'm the getting the following error:
Too many rows 50001.
I also checked the following query:
select count_distinct(product.productcode) from equipment__c
I got the count as 689. so i want to print these 689 product codes in vf page.
I also tried GROUP BY clause. but it throws an error
Aggregate query does not support querymore(), use LIMIT to restrict the results to a single batch.
please help, how can i get distinct product codes..