Monday, June 2, 2014

How to use Aggregate SOQL

Aggregate functions in SOQL, such as SUM() and MAX(), allow you to roll up and summarize your data in a query. You can use aggregate functions without using a GROUP BY clause. To get result of aggregate Soql query we have to use AggregateResult array or list.

Aggregate Function : 
  • AVG()
  • COUNT() and COUNT(fieldName)
  • COUNT_DISTINCT()
  • MIN()
  • MAX()
  • SUM()
However, these functions become a more powerful tool to generate reports when you use them with a GROUP BY clause. 

No comments:

Post a Comment