非常に大きい SOQL クエリの処理

参考

50000超えたレコード数取得の場合

Integer intCount = 0;
for (AggregateResult result : [SELECT COUNT(Id) cnt from objName__c]) {
    intCount+=(Integer)result.get('cnt');
}
System.debug('No of records are: '+intCount); 

猜你喜欢

转载自blog.csdn.net/neusoft06/article/details/80609286