---
title: SOQL Aggregate functions in Apex | MASTEK
description: SOQL Aggregate functions in salesforce include AVG(), COUNT() , MIN() , MAX(), SUM().It allows to rollup and summarize data in a query.
image: https://blog.mastek.com/hubfs/operationalResilience-Blog.jpg
---

[![Mastek-logo](https://www.mastek.com/wp-content/uploads/assets/icons/Mastek-logo.svg)](https://blog.mastek.com/)

- Mastek AI ![](https://www.mastek.com/wp-content/uploads/assets/icons/down.svg)
  
   AI For Technology ![](https://www.mastek.com/wp-content/themes/astra/assets/img/icons/arrow-up-right-b.svg)
  
   AI For Business
  
   AI For Data

  #### AI For Technology
  
   Accelerate software delivery, modernize legacy platforms, and secure operations with intelligent AI. 
  
  [LEARN MORE ![](https://www.mastek.com/wp-content/themes/astra/assets/img/icons/arrow-up-right.svg)](https://www.mastek.com/ai/ai-for-technology/)

    - [AI for Legacy Modernization](https://www.mastek.com/ai/ai-led-legacy-modernization-services/)
    - [AI for Software Testing](https://www.mastek.com/ai/ai-for-software-testing/)
    - [AI for Managed Services](https://www.mastek.com/ai/gen-ai-managed-services/)
    - [Mastek AI Platform powered by OpenAna](https://www.mastek.com/ai/autonomous-software-engineer-platform/)

  #### AI For Business
  
   Embed AI into enterprise platforms to automate workflows and improve decisions. 
  
  [LEARN MORE ![](https://www.mastek.com/wp-content/themes/astra//assets/img/icons/arrow-up-right.svg)](https://www.mastek.com/ai/ai-for-business/)

    - [AI for Oracle ![](https://www.mastek.com/wp-content/themes/astra//assets/img/icons/arrow-up-right-b.svg)](https://www.mastek.com/ai/oracle-ai-services/)
    - [AI for Salesforce](https://www.mastek.com/ai/ai-for-salesforce/)

  #### AI For Data
  
   Transform enterprise data into actionable intelligence with AI-driven insights. 
  
  [LEARN MORE ![](https://www.mastek.com/wp-content/themes/astra//assets/img/icons/arrow-up-right.svg)](https://www.mastek.com/ai/ai-for-data/)

    - [AI led Data Modernization](https://www.mastek.com/services/data-automation-and-ai/cloud-modernization/)
    - [AI led Data Engineering](https://www.mastek.com/services/data-automation-and-ai/data-modernization-solution-accelerator/)
- [Services ![](https://www.mastek.com/wp-content/uploads/assets/icons/down.svg)](https://www.mastek.com/services/)
  
   Digital Engineering & Experience ![](https://www.mastek.com/wp-content/uploads/assets/icons/arrow-up-right.svg)
  
   Data And AI Services
  
   Oracle Cloud
  
   Salesforce
  
   Managed Services
  
   Cybersecurity

  #### Digital Engineering & Experience
  
   Accelerate software delivery, modernize legacy platforms, and secure operations with intelligent AI. 
  
  [LEARN MORE ![](https://www.mastek.com/wp-content/uploads/assets/icons/arrow-up-right.svg)](https://www.mastek.com/services/digital-engineering-and-experience/)

    - [Cloud Migration](https://www.mastek.com/services/digital-engineering-and-experience/cloud-migration-and-modernization/)
    - [Cloud Engineering](https://www.mastek.com/services/digital-engineering-and-experience/cloud-engineering/)
    - [Low Code](https://www.mastek.com/services/digital-engineering-and-experience/low-code-no-code-development/)
    - [DevSecOps](https://www.mastek.com/services/digital-engineering-and-experience/devsecops/)
    - [Quality Engineering](https://www.mastek.com/services/digital-engineering-and-experience/quality-engineering/)
    - [MACH](https://www.mastek.com/services/digital-engineering-and-experience/mach/)
    - [Platform Engineering](https://www.mastek.com/services/digital-engineering-and-experience/platform-engineering/)
    - [Digital Experience](https://www.mastek.com/services/digital-engineering-and-experience/digital-experience/)
    - [Digital Commerce](https://www.mastek.com/services/digital-engineering-and-experience/digital-experience-commerce/)
    - [Enterprise Integration](https://www.mastek.com/services/digital-engineering-and-experience/enterprise-integration-services/)

  #### [Data and AI Services](https://www.mastek.com/services/data-automation-and-ai/)
  
  Data platforms, governance and AI acceleration services.
  
  [LEARN MORE ![](https://www.mastek.com/wp-content/uploads/assets/icons/arrow-up-right.svg)](https://www.mastek.com/services/data-automation-and-ai/)

    - [Cloud Data Modernization](https://www.mastek.com/services/data-automation-and-ai/cloud-modernization/)
    - [Data Engineering](https://www.mastek.com/services/data-automation-and-ai/data-management/)
    - [AI-Led Data Managed Services](https://www.mastek.com/services/data-automation-and-ai/ai-led-data-managed-services/)
    - [AI, ML & Data Insights](https://www.mastek.com/services/data-automation-and-ai/ai/)

  #### [Oracle Cloud](https://www.mastek.com/services/oracle/)
  
  Oracle implementation, modernization and managed services.
  
  [LEARN MORE ![](https://www.mastek.com/wp-content/uploads/assets/icons/arrow-up-right.svg)](https://www.mastek.com/services/oracle/)

    - [AI for Oracle](https://www.mastek.com/ai/oracle-ai-services/)
    - [Oracle Cloud Applications](https://www.mastek.com/services/oracle/oracle-cloud-applications/)
    - [Glide 4.0](https://www.mastek.com/services/business-transformation-services/)
    - [Oracle E-Business Suite](https://www.mastek.com/services/oracle/ebs-to-cloud-migration/)
    - [Oracle Consulting](https://www.mastek.com/services/oracle/consulting/)
    - [AdvantEdge IaaS](https://www.mastek.com/services/oracle/advantedge-migrate-to-cloud/)
    - [SAP to Cloud Migration](https://www.mastek.com/services/sap-to-oracle-migration/)
    - [PeopleSoft to Cloud Migration](https://www.mastek.com/services/oracle/peoplesoft-to-cloud-migration/)
    - [Oracle Analytics Cloud](https://www.mastek.com/services/oracle/analytics-cloud/)
    - [Oracle Cloud Infrastructure](https://www.mastek.com/services/oracle/oracle-cloud-infrastructure/)
    - [Oracle Autonomous Data Warehouse](https://www.mastek.com/services/oracle/autonomous-data-warehouse/)
    - [Value Based Analytics](https://www.mastek.com/services/oracle/value-based-analytics/)

  #### [Salesforce](https://www.mastek.com/services/salesforce/)
  
  Salesforce consulting, build and run services.
  
  [LEARN MORE ![](https://www.mastek.com/wp-content/uploads/assets/icons/arrow-up-right.svg)](https://www.mastek.com/services/salesforce/)

    - [Sales Cloud](https://www.mastek.com/services/salesforce/sales-cloud/)
    - [Service Cloud](https://www.mastek.com/services/salesforce/service-cloud/)
    - [Experience Cloud](https://www.mastek.com/services/salesforce/experience-cloud/)
    - [Marketing Cloud](https://www.mastek.com/services/salesforce/marketing-automation/)
    - [Commerce Cloud](https://www.mastek.com/services/salesforce/commerce-cloud/)
    - [Industry Cloud](https://www.mastek.com/services/salesforce/industry-cloud/)
    - [MuleSoft](https://www.mastek.com/services/salesforce/mulesoft-integration/)
    - [Data Cloud](https://www.mastek.com/services/salesforce/data-cloud/)
    - [Agentforce](https://www.mastek.com/services/salesforce/agentforce-partner/)

  #### [Managed Services](https://www.mastek.com/services/cloud-managed-services/)
  
  Run, optimise and evolve your Oracle, Salesforce, Digital and Data platforms with **Mastek's AI-Native Managed Services**.
  
  [LEARN MORE ![](https://www.mastek.com/wp-content/uploads/assets/icons/arrow-up-right.svg)](https://www.mastek.com/services/cloud-managed-services/)

    - [Oracle Managed Services](https://www.mastek.com/services/oracle/oracle-managed-services/)

  #### [Cybersecurity](https://www.mastek.com/services/cybersecurity/)
  
  AI-led cybersecurity with faster, smarter response.
  
  [LEARN MORE ![](https://www.mastek.com/wp-content/uploads/assets/icons/arrow-up-right.svg)](https://www.mastek.com/services/cybersecurity/)
- Products ![](https://www.mastek.com/wp-content/uploads/assets/icons/down.svg)
  
    - [Platforms & Innovation ![](https://www.mastek.com/wp-content/uploads/assets/icons/arrow-up-right.svg)](https://www.mastek.com/products/platforms-and-innovation/)
    - [SQL Next AI](https://sqlnextai.com/)
    - [Lightbeam AI](https://web.lightbeamdatacloud.com)
    - [icxPro](https://www.mastek.com/products/platforms-and-innovation/mastek-icxpro/)
    - [iLeaseFinPro Vehicle Leasing Software](https://www.mastek.com/products/platforms-and-innovation/ileasepro-vehicle-leasing-software/)

    - [Warehouse 360](https://www.mastek.com/products/platforms-and-innovation/warehouse360/)
    - [Enterprise Workforce Scheduler](https://www.mastek.com/products/platforms-and-innovation/enterprise-workforce-scheduler/)
    - [Connected Enterprise](https://www.mastek.com/products/platforms-and-innovation/connected-enterprise/)
    - [Innovation Lab-aaS](https://www.mastek.com/products/innovation-lab)
    - [Hospital in a Box](https://www.mastek.com/products/platforms-and-innovation/oracle-healthcare-erp-platform-for-hospitals/)
- Industries ![](https://www.mastek.com/wp-content/uploads/assets/icons/down.svg)
  
    - [Public Sector & Government](https://www.mastek.com/industries/public-sector-government/)
    - [Healthcare](https://www.mastek.com/industries/healthcare/)
    - [Life Sciences](https://www.mastek.com/industries/life-sciences/)
    - [Retail & Consumer](https://www.mastek.com/industries/retail/)

    - [Manufacturing & Technology](https://www.mastek.com/industries/manufacturing/)
    - [Financial Services](https://www.mastek.com/industries/financial-services/)
    - [Other Industries](https://www.mastek.com/industries/others/)
- Insights ![](https://www.mastek.com/wp-content/uploads/assets/icons/down.svg)
  
    - [Success Stories](https://www.mastek.com/resources-list/?cat=case-study)
    - [News](https://www.mastek.com/news-list/)
    - [Press Releases](https://www.mastek.com/press-releases/)
    - [Blog](https://blog.mastek.com/)

    - [Resources](https://www.mastek.com/resources-list/)
    - [Glossary](https://www.mastek.com/glossary/)
    - [Webinars & Events](https://www.mastek.com/events/)
    - [Podcast](https://www.mastek.com/podcast/)
- ![](https://www.mastek.com/wp-content/uploads/assets/icons/menu.svg)
  
  ##### Partners
  
    - [About Partnerships](https://www.mastek.com/partners-alliances/)
    - [Oracle Partner](https://www.mastek.com/services/oracle/)
    - [Salesforce Partner](https://www.mastek.com/partners-alliances/salesforce-partner/)
    - [AWS Partner](https://www.mastek.com/partners-alliances/aws-partner/)
    - [Microsoft Partner](https://www.mastek.com/partners-alliances/microsoft/)
    - [Snowflake Premier Partner](https://www.mastek.com/partners-alliances/snowflake-partner/)
    - [UiPath Partner](https://www.mastek.com/partners-alliances/uipath-partner/)
    - [ServiceNow Partner](https://www.mastek.com/partners-alliances/servicenow-partner/)
    - [HiveMQ Partner](https://www.mastek.com/partners-alliances/hivemq-partner/)

  ##### Insights
  
    - [Success Stories](https://www.mastek.com/resources-list/?cat=case-study)
    - [News](https://www.mastek.com/news-list/)
    - [Press Releases](https://www.mastek.com/press-releases/)
    - [Blog](https://blog.mastek.com/)
    - [Resources](https://www.mastek.com/resources-list/)
    - [Glossary](https://www.mastek.com/glossary/)
    - [Webinars & Events](https://www.mastek.com/events/)
    - [Podcast](https://www.mastek.com/podcast/)
- [CONTACT US](https://www.mastek.com/contact-us/)

## Mastek AI

- [Overview](https://www.mastek.com/ai/)

## AI For Technology

- [Overview](https://www.mastek.com/ai/ai-for-technology/)
- [AI for Legacy Modernization](https://www.mastek.com/ai/ai-led-legacy-modernization-services/)
- [AI for Software Testing](https://www.mastek.com/ai/ai-for-software-testing/)
- [AI for Managed Services](https://www.mastek.com/ai/gen-ai-managed-services/)
- [Mastek AI Platform powered by OpenAna](https://www.mastek.com/ai/autonomous-software-engineer-platform/)

## AI For Business

- [Overview](https://www.mastek.com/ai/ai-for-business/)
- [AI for Oracle](https://www.mastek.com/ai/oracle-ai-services/)
- [AI for Salesforce](https://www.mastek.com/ai/ai-for-salesforce/)

## AI For Data

- [Overview](https://www.mastek.com/ai/ai-for-data/)
- [AI led Data Modernization](https://www.mastek.com/services/data-automation-and-ai/cloud-modernization/)
- [AI led Data Engineering](https://www.mastek.com/services/data-automation-and-ai/data-modernization-solution-accelerator/)
- [AI-Led Data Managed Services](https://www.mastek.com/services/data-automation-and-ai/ai-led-data-managed-services/)

## Services

- [Overview](https://www.mastek.com/services/)

## Digital Engineering & Experience

- [Overview](https://www.mastek.com/services/digital-engineering-and-experience/)
- [Cloud Migration](https://www.mastek.com/services/digital-engineering-and-experience/cloud-migration-and-modernization/)
- [Cloud Engineering](https://www.mastek.com/services/digital-engineering-and-experience/cloud-engineering/)
- [Low Code](https://www.mastek.com/services/digital-engineering-and-experience/low-code-no-code-development/)
- [DevSecOps](https://www.mastek.com/services/digital-engineering-and-experience/devsecops/)
- [Quality Engineering](https://www.mastek.com/services/digital-engineering-and-experience/quality-engineering/)
- [MACH](https://www.mastek.com/services/digital-engineering-and-experience/mach/)
- [Platform Engineering](https://www.mastek.com/services/digital-engineering-and-experience/platform-engineering/)
- [Digital Experience](https://www.mastek.com/services/digital-engineering-and-experience/digital-experience/)
- [Digital Commerce](https://www.mastek.com/services/digital-engineering-and-experience/digital-experience-commerce/)
- [Enterprise Integration](https://www.mastek.com/services/digital-engineering-and-experience/enterprise-integration-services/)

## Data and AI Services

- [Overview](https://www.mastek.com/services/data-automation-and-ai/)
- [Cloud Data Modernization](https://www.mastek.com/services/data-automation-and-ai/cloud-modernization/)
- [Data Engineering](https://www.mastek.com/services/data-automation-and-ai/data-management/)
[AI, ML & Data Insights](https://www.mastek.com/services/data-automation-and-ai/ai/)

## Oracle Cloud

- [Overview](https://www.mastek.com/services/oracle/)
- [AI for Oracle](https://www.mastek.com/ai/oracle-ai-services/)
- [Oracle Cloud Applications](https://www.mastek.com/services/oracle/oracle-cloud-applications/)
- [Glide 4.0](https://www.mastek.com/services/business-transformation-services/)
- [Oracle E-Business Suite](https://www.mastek.com/services/oracle/ebs-to-cloud-migration/)
- [Oracle Consulting](https://www.mastek.com/services/oracle/consulting/)
- [AdvantEdge IaaS](https://www.mastek.com/services/oracle/advantedge-migrate-to-cloud/)
- [SAP to Cloud Migration](https://www.mastek.com/services/sap-to-oracle-migration/)
- [PeopleSoft to Cloud Migration](https://www.mastek.com/services/oracle/peoplesoft-to-cloud-migration/)
- [Oracle Analytics Cloud](https://www.mastek.com/services/oracle/analytics-cloud/)
- [Oracle Cloud Infrastructure](https://www.mastek.com/services/oracle/oracle-cloud-infrastructure/)
- [Oracle Autonomous Data Warehouse](https://www.mastek.com/services/oracle/autonomous-data-warehouse/)
- [Value Based Analytics](https://www.mastek.com/services/oracle/value-based-analytics/)

## Salesforce

- [Overview](https://www.mastek.com/services/salesforce/)
- [Sales Cloud](https://www.mastek.com/services/salesforce/sales-cloud/)
- [Service Cloud](https://www.mastek.com/services/salesforce/service-cloud/)
- [Experience Cloud](https://www.mastek.com/services/salesforce/experience-cloud/)
- [Marketing Cloud](https://www.mastek.com/services/salesforce/marketing-automation/)
- [Commerce Cloud](https://www.mastek.com/services/salesforce/commerce-cloud/)
- [Industry Cloud](https://www.mastek.com/services/salesforce/industry-cloud/)
- [MuleSoft](https://www.mastek.com/services/salesforce/mulesoft-integration/)
- [Data Cloud](https://www.mastek.com/services/salesforce/data-cloud/)
- [Agentforce](https://www.mastek.com/services/salesforce/agentforce-partner/)

## Managed Services

- [Overview](https://www.mastek.com/services/cloud-managed-services/)
- [Oracle Managed Services](https://www.mastek.com/services/oracle/oracle-managed-services/)

[Cybersecurity](https://www.mastek.com/services/cybersecurity/)

## Products

- [Platforms & Innovation](https://www.mastek.com/products/platforms-and-innovation/)
- [SQL Next AI](https://sqlnextai.com/)
- [Lightbeam AI](https://web.lightbeamdatacloud.com)
- [icxPro](https://www.mastek.com/products/platforms-and-innovation/mastek-icxpro/)
- [iLeaseFinPro Vehicle Leasing Software](https://www.mastek.com/products/platforms-and-innovation/ileasepro-vehicle-leasing-software/)
- [Warehouse 360](https://www.mastek.com/products/platforms-and-innovation/warehouse360/)
- [Enterprise Workforce Scheduler](https://www.mastek.com/products/platforms-and-innovation/enterprise-workforce-scheduler/)
- [Connected Enterprise](https://www.mastek.com/products/platforms-and-innovation/connected-enterprise/)
- [Innovation Lab-aaS](https://www.mastek.com/products/innovation-lab)
- [Hospital in a Box](https://www.mastek.com/products/platforms-and-innovation/oracle-healthcare-erp-platform-for-hospitals/)

## Industries

- [Overview](https://www.mastek.com/industries/)
- [Public Sector & Government](https://www.mastek.com/industries/public-sector-government/)
- [Healthcare](https://www.mastek.com/industries/healthcare/)
- [Life Sciences](https://www.mastek.com/industries/life-sciences/)
- [Retail & Consumer](https://www.mastek.com/industries/retail/)
- [Manufacturing & Technology](https://www.mastek.com/industries/manufacturing/)
- [Financial Services](https://www.mastek.com/industries/financial-services/)
- [Other Industries](https://www.mastek.com/industries/others/)

## Partners

- [About Partnerships](https://www.mastek.com/partners-alliances/)
- [Oracle Partner](https://www.mastek.com/services/oracle/)
- [Salesforce Partner](https://www.mastek.com/partners-alliances/salesforce-partner/)
- [AWS Partner](https://www.mastek.com/partners-alliances/aws-partner/)
- [Microsoft Partner](https://www.mastek.com/partners-alliances/microsoft/)
- [Snowflake Premier Partner](https://www.mastek.com/partners-alliances/snowflake-partner/)
- [UiPath Partner](https://www.mastek.com/partners-alliances/uipath-partner/)
- [ServiceNow Partner](https://www.mastek.com/partners-alliances/servicenow-partner/)
- [HiveMQ Partner](https://www.mastek.com/partners-alliances/hivemq-partner/)

## Insights

- [Success Stories](https://www.mastek.com/resources-list/?cat=case-study)
- [News](https://www.mastek.com/news-list/)
- [Press Releases](https://www.mastek.com/press-releases/)
- [Blog](https://blog.mastek.com/)
- [Resources](https://www.mastek.com/resources-list/)
- [Glossary](https://www.mastek.com/glossary/)
- [Webinars & Events](https://www.mastek.com/events/)
- [Podcast](https://www.mastek.com/podcast/)

## Company

- [About Mastek](https://www.mastek.com/about-us/)
- [Leadership](https://www.mastek.com/leadership/)
- [Investors](https://www.mastek.com/investors/)
- [Careers](https://www.mastek.com/careers/)
- [Our Story](https://www.mastek.com/our-story/)
- [ESG](https://www.mastek.com/esg/)
- [ReShine](https://www.mastek.com/reshine/)

[CONTACT US](https://www.mastek.com/contact-us/)

## Mastek Blog

# [SOQL Aggregate functions in Apex](https://blog.mastek.com/soql-aggregate-functions-in-apex)

 13 Mar 2023, 01:40:58 / by [Karthikeyan Mohandoss](https://blog.mastek.com/author/karthikeyan-mohandoss)

![Karthikeyan Mohandoss](https://blog.mastek.com/hubfs/1611207435414.jfif)

- [Tweet](https://twitter.com/share)

 

**Lightning web components are built using HTML and JavaScript. Lightning web components can be used in Aura components and inter-operate with each other. We can find Lightning web components and Aura components under Lightning components in Setup.**

 

 

![Operational resilience blog banner](https://blog.mastek.com/hs-fs/hubfs/operationalResilience-Blog.jpg?width=1280&height=854&name=operationalResilience-Blog.jpg)

 

Aggregate functions in salesforce include AVG(), COUNT(), MIN(), MAX(), SUM(). The functions like  SUM() and MAX() in SOQL allow to roll up and summarize the data in a query. The GROUP BY clause in a SOQL query is to avoid iterating through individual query results and used to specify a group of records instead of processing many individual records.

           1. AVG() – Returns the average value of a numeric field  
          2. COUNT() – Returns the number of rows matching the query criteria

          3. MIN() – Returns the minimum value of a field

          4.MAX() – Returns the maximum value of a field

          5.SUM() – Returns the total sum of a numeric field

A query that includes an aggregate function returns its results in an array of AggregateResult objects. AggregateResult is a read-only sObject and is only used for query results. The values in the AggregateResult object can be accessed much like a map calling a “get” method with the name of the column.

The example Apex Trigger used below is based on the Payment custom object that has a lookup to the Contact and Project objects. Aggregate functions like sum(), max() are used in the query. The sum() is used for the amount field to get the sum of the payment amount made for the project by a contact, max() is to get the last payment date made for the project. The AggregateResult query is used to capture the result of the query and to get the value using an alias name.

**Paymentrigger:** 

```
Trigger paymentrigger on payment__c (after insert,after update,after unDelete,after delete) {     map<id,project__c> updateMap =new map<id,project__c>();     map<id,contact> updateMap1 =new map<id,contact>();     set connameset=new set();     set projnameset=new set();     if(Trigger.isInsert|| Trigger.isUpdate|| Trigger.isUnDelete){         for(payment__c pay:Trigger.new){             if(pay.project__c != null)                 projnameset.add(pay.project__c);             if(pay.Contact__c != null)                 connameset.add(pay.Contact__c);         }     }     if(Trigger.isDelete){         for(payment__c pays:Trigger.old){             if(pays.project__c!=null)                 projnameset.add(pays.project__c);             if(pays.contact__c!=null)                connameset.add(pays.contact__c);                     }     }         List AggregateResultList = [select project__c,Sum(amount__c)amt,max (Payment_date__c) maxDate from payment__c where project__c in:projnameset group by project__c];     if(AggregateResultList != null && AggregateResultList.size() > 0){         for(AggregateResult aggr:AggregateResultList){                         project__c pr1=new project__c();             pr1.recentpay__c=(date)aggr.get('maxDate');             pr1.Id=(id)aggr.get('project__c');             pr1.total_amount__c=(decimal)aggr.get('amt');             updateMap.put(pr1.Id, pr1);         }     }else {         for(id idSet:projnameset){             project__c pr1=new project__c();             pr1.recentpay__c=null;             pr1.Id=idSet;             pr1.total_amount__c=0;             updateMap.put(pr1.Id, pr1);         }     }     update updateMap.values();         list AggregateResultList1=[select Contact__c,sum(amount__c)amts from payment__c where Contact__c in:connameset group by Contact__c];     if(AggregateResultList1!= null && AggregateResultList1.size() > 0){         for(AggregateResult agg:AggregateResultList1){             Contact con=new Contact();             con.Id=(id)agg.get('Contact__C');             con.total_amount__c=(decimal)agg.get('amts');             updatemap1.put(con.Id, con);         }     }else{         for(id idset1:connameset){             Contact con=new Contact();             con.Id=idset1;             con.total_amount__c=0;             updatemap1.put(con.Id, con);         }     }     update updatemap1.values();     } 
```

![Soql Functions](https://www.mstsolutions.com/wp-content/uploads/2020/12/image-170.png)

![Apex Functions](https://www.mstsolutions.com/wp-content/uploads/2020/12/image-171.png)

The above screenshots show two payment records and the red highlight area shows the payment date and the amount paid for the project bsnl by the contact karthi.

![Soql Aggregate Functions](https://www.mstsolutions.com/wp-content/uploads/2020/12/image-172.png)

The above screenshot shows the project record with recent pay field with the date retrieved from the aggregate result of the query by using a max() to get the last payment date made for the project bsnl. The total amount field shows the total amount paid for the project by using the sum() function.

**Reference Link:** 

1\. https://developer.salesforce.com/docs/atlas.en- us.apexcode.meta/ apexcode/langCon\_apex \_SOQL\_agg\_fns.htm

2. [https://developer. salesforce.com/docs/atlas.en-us.soql\_sosl.meta/soql\_sosl/ sforce\_api\_calls\_soql\_select \_agg\_functions.htm](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_agg_functions.htm)

3\. https://developer. salesforce.com/docs/atlas.en-us.api.meta/api/sforce\_ api\_calls\_query\_ aggregateresult.htm

 

 Topics: [Apex](https://blog.mastek.com/topic/apex)

![Karthikeyan Mohandoss](https://blog.mastek.com/hubfs/1611207435414.jfif)

#### Written by [Karthikeyan Mohandoss](https://blog.mastek.com/author/karthikeyan-mohandoss)

Karthikeyan is a Manager and Salesforce Architect at Mastek. An 18x Certified Double Star Ranger, he specializes in building complex, scalable ecosystems.

<https://www.linkedin.com/in/karthikeyan-mohandoss-582a4bba/>

### Subscribe to Email Updates

- Recent
- Popular
- Categories

### Lists by Topic

- [AI (94)](https://blog.mastek.com/topic/ai)
- [Digital Transformation (83)](https://blog.mastek.com/topic/digital-transformation)
- [Healthcare (50)](https://blog.mastek.com/topic/healthcare)
- [Data (48)](https://blog.mastek.com/topic/data)
- [Salesforce (39)](https://blog.mastek.com/topic/salesforce)
- [Gen AI (37)](https://blog.mastek.com/topic/gen-ai)
- [Oracle (36)](https://blog.mastek.com/topic/oracle)
- [Artificial Intelligence (34)](https://blog.mastek.com/topic/artificial-intelligence)
- [AI technologies (25)](https://blog.mastek.com/topic/ai-technologies)
- [Health Cloud (21)](https://blog.mastek.com/topic/health-cloud)
- [Retail (20)](https://blog.mastek.com/topic/retail)
- [Retail Tech (17)](https://blog.mastek.com/topic/retail-tech)
- [Cloud Technology (16)](https://blog.mastek.com/topic/cloud-technology)
- [thoughtleadership (14)](https://blog.mastek.com/topic/thoughtleadership)
- [Customer Experience (13)](https://blog.mastek.com/topic/customer-experience)
- [Managed Services (13)](https://blog.mastek.com/topic/managed-services)
- [Brand Champion (10)](https://blog.mastek.com/topic/brand-champion)
- [Cloud migration (10)](https://blog.mastek.com/topic/cloud-migration)
- [Ethical AI (10)](https://blog.mastek.com/topic/ethical-ai)
- [Passion club stories (10)](https://blog.mastek.com/topic/passion-club-stories)
- [leadership (10)](https://blog.mastek.com/topic/leadership)
- [IoT (9)](https://blog.mastek.com/topic/iot)
- [oracle HCM (9)](https://blog.mastek.com/topic/oracle-hcm)
- [Financial Services (8)](https://blog.mastek.com/topic/financial-services)
- [Public Sector (8)](https://blog.mastek.com/topic/public-sector)
- [RPA (8)](https://blog.mastek.com/topic/rpa)
- [UK Public Sector (8)](https://blog.mastek.com/topic/uk-public-sector)
- [data analysis (8)](https://blog.mastek.com/topic/data-analysis)
- [AI in Healthcare (7)](https://blog.mastek.com/topic/ai-in-healthcare)
- [Digital Service Design (7)](https://blog.mastek.com/topic/digital-service-design)
- [Oracle Cloud Application (7)](https://blog.mastek.com/topic/oracle-cloud-application)
- [Supply Chain (7)](https://blog.mastek.com/topic/supply-chain)
- [customer data platforms (7)](https://blog.mastek.com/topic/customer-data-platforms)
- [data governance (7)](https://blog.mastek.com/topic/data-governance)
- [data modernisation (7)](https://blog.mastek.com/topic/data-modernisation)
- [hcm (7)](https://blog.mastek.com/topic/hcm)
- [healthcare data (7)](https://blog.mastek.com/topic/healthcare-data)
- [Agile (6)](https://blog.mastek.com/topic/agile)
- [Business Process Automation (6)](https://blog.mastek.com/topic/business-process-automation)
- [Cloud Enhancement Services (6)](https://blog.mastek.com/topic/cloud-enhancement-services)
- [Cloud-based AI (6)](https://blog.mastek.com/topic/cloud-based-ai)
- [Government (6)](https://blog.mastek.com/topic/government)
- [ML (6)](https://blog.mastek.com/topic/ml)
- [Machine Learning (6)](https://blog.mastek.com/topic/machine-learning)
- [Manufacturing (6)](https://blog.mastek.com/topic/manufacturing)
- [Oracle ERP (6)](https://blog.mastek.com/topic/oracle-erp)
- [Oracle ERP Cloud (6)](https://blog.mastek.com/topic/oracle-erp-cloud)
- [data analytics (6)](https://blog.mastek.com/topic/data-analytics)
- [retail operations (6)](https://blog.mastek.com/topic/retail-operations)
- [Agentic AI (5)](https://blog.mastek.com/topic/agentic-ai)
- [Data Security (5)](https://blog.mastek.com/topic/data-security)
- [IT service management (ITSM) (5)](https://blog.mastek.com/topic/it-service-management-itsm)
- [Intelligent Automation (5)](https://blog.mastek.com/topic/intelligent-automation)
- [NHS (5)](https://blog.mastek.com/topic/nhs)
- [UK Central Government (5)](https://blog.mastek.com/topic/uk-central-government)
- [cybersecurity (5)](https://blog.mastek.com/topic/cybersecurity)
- [research (5)](https://blog.mastek.com/topic/research)
- [AI Strategy (4)](https://blog.mastek.com/topic/ai-strategy)
- [AI agents (4)](https://blog.mastek.com/topic/ai-agents)
- [AI and data (4)](https://blog.mastek.com/topic/ai-and-data)
- [CRM transformation (4)](https://blog.mastek.com/topic/crm-transformation)
- [Digital Workforce (4)](https://blog.mastek.com/topic/digital-workforce)
- [Digital commerce (4)](https://blog.mastek.com/topic/digital-commerce)
- [Future Tech (4)](https://blog.mastek.com/topic/future-tech)
- [Innovation (4)](https://blog.mastek.com/topic/innovation)
- [Intelligent Automation vs RPA (4)](https://blog.mastek.com/topic/intelligent-automation-vs-rpa)
- [Operational Resilience (4)](https://blog.mastek.com/topic/operational-resilience)
- [Oracle Partner (4)](https://blog.mastek.com/topic/oracle-partner)
- [Technology (4)](https://blog.mastek.com/topic/technology)
- [Testing (4)](https://blog.mastek.com/topic/testing)
- [Transformation (4)](https://blog.mastek.com/topic/transformation)
- [cloud implementation (4)](https://blog.mastek.com/topic/cloud-implementation)
- [data modernization (4)](https://blog.mastek.com/topic/data-modernization)
- [edge computing (4)](https://blog.mastek.com/topic/edge-computing)
- [erp cloud implementation (4)](https://blog.mastek.com/topic/erp-cloud-implementation)
- [higher education (4)](https://blog.mastek.com/topic/higher-education)
- [logistics (4)](https://blog.mastek.com/topic/logistics)
- [mortgages (4)](https://blog.mastek.com/topic/mortgages)
- [mulesoft (4)](https://blog.mastek.com/topic/mulesoft)
- [snowflake (4)](https://blog.mastek.com/topic/snowflake)
- [workplace (4)](https://blog.mastek.com/topic/workplace)
- [Compliance (3)](https://blog.mastek.com/topic/compliance)
- [Data management (3)](https://blog.mastek.com/topic/data-management)
- [Government Digital services (3)](https://blog.mastek.com/topic/government-digital-services)
- [Oracle SCM (3)](https://blog.mastek.com/topic/oracle-scm)
- [Passion Club (3)](https://blog.mastek.com/topic/passion-club)
- [RPA Implementation (3)](https://blog.mastek.com/topic/rpa-implementation)
- [Robotic Automation (3)](https://blog.mastek.com/topic/robotic-automation)
- [Salesforce Integration (3)](https://blog.mastek.com/topic/salesforce-integration)
- [Sustainability (3)](https://blog.mastek.com/topic/sustainability)
- [Transportation (3)](https://blog.mastek.com/topic/transportation)
- [UK ports (3)](https://blog.mastek.com/topic/uk-ports)
- [agentforce (3)](https://blog.mastek.com/topic/agentforce)
- [analytics (3)](https://blog.mastek.com/topic/analytics)
- [b2b (3)](https://blog.mastek.com/topic/b2b)
- [business outcomes (3)](https://blog.mastek.com/topic/business-outcomes)
- [cio (3)](https://blog.mastek.com/topic/cio)
- [consumer market (3)](https://blog.mastek.com/topic/consumer-market)
- [crm (3)](https://blog.mastek.com/topic/crm)
- [governance (3)](https://blog.mastek.com/topic/governance)
- [human resources (3)](https://blog.mastek.com/topic/human-resources)
- [intelligent parts assistant (3)](https://blog.mastek.com/topic/intelligent-parts-assistant)
- [metaverse (3)](https://blog.mastek.com/topic/metaverse)
- [microsoft (3)](https://blog.mastek.com/topic/microsoft)
- [strategy (3)](https://blog.mastek.com/topic/strategy)
- [work management (3)](https://blog.mastek.com/topic/work-management)
- [ADOPT (2)](https://blog.mastek.com/topic/adopt)
- [AI Agent Studio (2)](https://blog.mastek.com/topic/ai-agent-studio)
- [AIoT (2)](https://blog.mastek.com/topic/aiot)
- [AppDev (2)](https://blog.mastek.com/topic/appdev)
- [Automation Testing (2)](https://blog.mastek.com/topic/automation-testing)
- [Cloud Adoption (2)](https://blog.mastek.com/topic/cloud-adoption)
- [Customer Engagement (2)](https://blog.mastek.com/topic/customer-engagement)
- [Customer Insight (2)](https://blog.mastek.com/topic/customer-insight)
- [Data Science (2)](https://blog.mastek.com/topic/data-science)
- [DevOps culture (2)](https://blog.mastek.com/topic/devops-culture)
- [ESG (2)](https://blog.mastek.com/topic/esg)
- [GDPR (2)](https://blog.mastek.com/topic/gdpr)
- [Government Tech (2)](https://blog.mastek.com/topic/government-tech)
- [Higher Education Digital Transformation  (2)](https://blog.mastek.com/topic/higher-education-digital-transformation)
- [IIOT (2)](https://blog.mastek.com/topic/iiot)
- [Identity & Access Management (2)](https://blog.mastek.com/topic/identity-access-management)
- [Intelligent Automation tools (2)](https://blog.mastek.com/topic/intelligent-automation-tools)
- [Intelligent Process Automation (2)](https://blog.mastek.com/topic/intelligent-process-automation)
- [Mobile Testing (2)](https://blog.mastek.com/topic/mobile-testing)
- [Oracle Redwood (2)](https://blog.mastek.com/topic/oracle-redwood)
- [Project Management (2)](https://blog.mastek.com/topic/project-management)
- [SCM (2)](https://blog.mastek.com/topic/scm)
- [Security (2)](https://blog.mastek.com/topic/security)
- [UX (2)](https://blog.mastek.com/topic/ux)
- [automating systems and processes (2)](https://blog.mastek.com/topic/automating-systems-and-processes)
- [business acceleration (2)](https://blog.mastek.com/topic/business-acceleration)
- [business analysis (2)](https://blog.mastek.com/topic/business-analysis)
- [business uncertainty (2)](https://blog.mastek.com/topic/business-uncertainty)
- [cloud modernization (2)](https://blog.mastek.com/topic/cloud-modernization)
- [connected enterprise (2)](https://blog.mastek.com/topic/connected-enterprise)
- [data integration (2)](https://blog.mastek.com/topic/data-integration)
- [data migration (2)](https://blog.mastek.com/topic/data-migration)
- [data protection (2)](https://blog.mastek.com/topic/data-protection)
- [data quality (2)](https://blog.mastek.com/topic/data-quality)
- [data-driven intelligence (2)](https://blog.mastek.com/topic/data-driven-intelligence)
- [diversity and inclusion (2)](https://blog.mastek.com/topic/diversity-and-inclusion)
- [ecommmerce (2)](https://blog.mastek.com/topic/ecommmerce)
- [erp consultant (2)](https://blog.mastek.com/topic/erp-consultant)
- [ethics (2)](https://blog.mastek.com/topic/ethics)
- [post pandemic (2)](https://blog.mastek.com/topic/post-pandemic)
- [work from home (2)](https://blog.mastek.com/topic/work-from-home)
- [#DevSecOps #SecOps #IAST #DAST #SAST #RASP (1)](https://blog.mastek.com/topic/devsecops-secops-iast-dast-sast-rasp)
- [AI Algorithms (1)](https://blog.mastek.com/topic/ai-algorithms)
- [AI in the social sector (1)](https://blog.mastek.com/topic/ai-in-the-social-sector)
- [AIinFinance (1)](https://blog.mastek.com/topic/aiinfinance)
- [Agile BI (1)](https://blog.mastek.com/topic/agile-bi)
- [Agile Testing (1)](https://blog.mastek.com/topic/agile-testing)
- [Agile with GDS (1)](https://blog.mastek.com/topic/agile-with-gds)
- [AgileAI (1)](https://blog.mastek.com/topic/agileai)
- [Apex (1)](https://blog.mastek.com/topic/apex)
- [Automated Testing (1)](https://blog.mastek.com/topic/automated-testing)
- [Automation (1)](https://blog.mastek.com/topic/automation)
- [Awards (1)](https://blog.mastek.com/topic/awards)
- [BI (1)](https://blog.mastek.com/topic/bi)
- [Banking (1)](https://blog.mastek.com/topic/banking)
- [BizAnalytica (1)](https://blog.mastek.com/topic/bizanalytica)
- [Brexit (1)](https://blog.mastek.com/topic/brexit)
- [CEO Insight (1)](https://blog.mastek.com/topic/ceo-insight)
- [CISO (1)](https://blog.mastek.com/topic/ciso)
- [CSR (1)](https://blog.mastek.com/topic/csr)
- [Campus Technology Solutions (1)](https://blog.mastek.com/topic/campus-technology-solutions)
- [Chat Bots (1)](https://blog.mastek.com/topic/chat-bots)
- [Cognitive RPA (1)](https://blog.mastek.com/topic/cognitive-rpa)
- [Cognitive Technologies (1)](https://blog.mastek.com/topic/cognitive-technologies)
- [Compatibility Testing (1)](https://blog.mastek.com/topic/compatibility-testing)
- [Continous Delivery (1)](https://blog.mastek.com/topic/continous-delivery)
- [DART Framework (1)](https://blog.mastek.com/topic/dart-framework)
- [Data Storage (1)](https://blog.mastek.com/topic/data-storage)
- [Data Strategy (1)](https://blog.mastek.com/topic/data-strategy)
- [Data Virtualisation (1)](https://blog.mastek.com/topic/data-virtualisation)
- [Data Visualisation (1)](https://blog.mastek.com/topic/data-visualisation)
- [Data availability (1)](https://blog.mastek.com/topic/data-availability)
- [DataGenius (1)](https://blog.mastek.com/topic/datagenius)
- [DataOps (1)](https://blog.mastek.com/topic/dataops)
- [Databricks (1)](https://blog.mastek.com/topic/databricks)
- [Deep Learning (1)](https://blog.mastek.com/topic/deep-learning)
- [Delivery (1)](https://blog.mastek.com/topic/delivery)
- [DevSecOps (1)](https://blog.mastek.com/topic/devsecops)
- [Devact (1)](https://blog.mastek.com/topic/devact)
- [EPM Cloud (1)](https://blog.mastek.com/topic/epm-cloud)
- [EUSS (1)](https://blog.mastek.com/topic/euss)
- [Education (1)](https://blog.mastek.com/topic/education)
- [Engineering colleges in Mumbai (1)](https://blog.mastek.com/topic/engineering-colleges-in-mumbai)
- [FCCS (1)](https://blog.mastek.com/topic/fccs)
- [Financial Consolidation and Close (1)](https://blog.mastek.com/topic/financial-consolidation-and-close)
- [Graduate Programme (1)](https://blog.mastek.com/topic/graduate-programme)
- [IT consulting (1)](https://blog.mastek.com/topic/it-consulting)
- [Industry 4.0 (1)](https://blog.mastek.com/topic/industry-4-0)
- [Industry trends (1)](https://blog.mastek.com/topic/industry-trends)
- [Legal tech (1)](https://blog.mastek.com/topic/legal-tech)
- [Low-Code (1)](https://blog.mastek.com/topic/low-code)
- [MOT Framework (1)](https://blog.mastek.com/topic/mot-framework)
- [Mobile Content (1)](https://blog.mastek.com/topic/mobile-content)
- [Modern AI (1)](https://blog.mastek.com/topic/modern-ai)
- [Natural Language Processing (1)](https://blog.mastek.com/topic/natural-language-processing)
- [OCI (1)](https://blog.mastek.com/topic/oci)
- [Oracle Cloud Infrastructure (1)](https://blog.mastek.com/topic/oracle-cloud-infrastructure)
- [Oracle EPBCS (1)](https://blog.mastek.com/topic/oracle-epbcs)
- [Oracle Field Service Cloud (1)](https://blog.mastek.com/topic/oracle-field-service-cloud)
- [Oracle Fusion (1)](https://blog.mastek.com/topic/oracle-fusion)
- [Project Deep Blue (1)](https://blog.mastek.com/topic/project-deep-blue)
- [Real Time Location Solutions (1)](https://blog.mastek.com/topic/real-time-location-solutions)
- [Recovery Testing (1)](https://blog.mastek.com/topic/recovery-testing)
- [SAP ECC (1)](https://blog.mastek.com/topic/sap-ecc)
- [SLA (1)](https://blog.mastek.com/topic/sla)
- [Salesforce Lightning (1)](https://blog.mastek.com/topic/salesforce-lightning)
- [Scalability (1)](https://blog.mastek.com/topic/scalability)
- [Scaling AI (1)](https://blog.mastek.com/topic/scaling-ai)
- [Scattered Spider (1)](https://blog.mastek.com/topic/scattered-spider)
- [Semiconductor (1)](https://blog.mastek.com/topic/semiconductor)
- [Serverless Cloud Architectures (1)](https://blog.mastek.com/topic/serverless-cloud-architectures)
- [Service Management (1)](https://blog.mastek.com/topic/service-management)
- [Software engineering (1)](https://blog.mastek.com/topic/software-engineering)
- [Student Engagement Solutions (1)](https://blog.mastek.com/topic/student-engagement-solutions)
- [TIS (1)](https://blog.mastek.com/topic/tis)
- [TalentGenius (1)](https://blog.mastek.com/topic/talentgenius)
- [Tech consultant (1)](https://blog.mastek.com/topic/tech-consultant)
- [TechNovation (1)](https://blog.mastek.com/topic/technovation)
- [Test Maturity (1)](https://blog.mastek.com/topic/test-maturity)
- [Trends in Testing (1)](https://blog.mastek.com/topic/trends-in-testing)
- [UK retail (1)](https://blog.mastek.com/topic/uk-retail)
- [University Automation (1)](https://blog.mastek.com/topic/university-automation)
- [Workers Compensation (1)](https://blog.mastek.com/topic/workers-compensation)
- [XLA (1)](https://blog.mastek.com/topic/xla)
- [analytics practice (1)](https://blog.mastek.com/topic/analytics-practice)
- [aws (1)](https://blog.mastek.com/topic/aws)
- [azure (1)](https://blog.mastek.com/topic/azure)
- [biometrics (1)](https://blog.mastek.com/topic/biometrics)
- [branding (1)](https://blog.mastek.com/topic/branding)
- [careers decomplexed (1)](https://blog.mastek.com/topic/careers-decomplexed)
- [change (1)](https://blog.mastek.com/topic/change)
- [claude (1)](https://blog.mastek.com/topic/claude)
- [contract management (1)](https://blog.mastek.com/topic/contract-management)
- [data modelling (1)](https://blog.mastek.com/topic/data-modelling)
- [data table (1)](https://blog.mastek.com/topic/data-table)
- [decomplexify (1)](https://blog.mastek.com/topic/decomplexify)
- [development (1)](https://blog.mastek.com/topic/development)
- [employee engagement (1)](https://blog.mastek.com/topic/employee-engagement)
- [employee experience (1)](https://blog.mastek.com/topic/employee-experience)
- [financial crime (1)](https://blog.mastek.com/topic/financial-crime)
- [industrial iot (1)](https://blog.mastek.com/topic/industrial-iot)
- [inhouse (1)](https://blog.mastek.com/topic/inhouse)
- [intelligent job connect (1)](https://blog.mastek.com/topic/intelligent-job-connect)
- [inventory management (1)](https://blog.mastek.com/topic/inventory-management)
- [jobconnect (1)](https://blog.mastek.com/topic/jobconnect)
- [legal (1)](https://blog.mastek.com/topic/legal)
- [life sciences (1)](https://blog.mastek.com/topic/life-sciences)
- [magento (1)](https://blog.mastek.com/topic/magento)
- [managed service partner (1)](https://blog.mastek.com/topic/managed-service-partner)
- [marketing (1)](https://blog.mastek.com/topic/marketing)
- [outsource (1)](https://blog.mastek.com/topic/outsource)
- [outsystems (1)](https://blog.mastek.com/topic/outsystems)
- [planning and budgeting (1)](https://blog.mastek.com/topic/planning-and-budgeting)
- [predective analytics (1)](https://blog.mastek.com/topic/predective-analytics)
- [productivity (1)](https://blog.mastek.com/topic/productivity)
- [provider (1)](https://blog.mastek.com/topic/provider)
- [public safety (1)](https://blog.mastek.com/topic/public-safety)
- [talent acquisition (1)](https://blog.mastek.com/topic/talent-acquisition)
- [testing partnership (1)](https://blog.mastek.com/topic/testing-partnership)
- [time management (1)](https://blog.mastek.com/topic/time-management)
- [user experience (1)](https://blog.mastek.com/topic/user-experience)
- [zero touch operations (1)](https://blog.mastek.com/topic/zero-touch-operations)

see all

### Posts by Topic

- [AI (94)](https://blog.mastek.com/topic/ai)
- [Digital Transformation (83)](https://blog.mastek.com/topic/digital-transformation)
- [Healthcare (50)](https://blog.mastek.com/topic/healthcare)
- [Data (48)](https://blog.mastek.com/topic/data)
- [Salesforce (39)](https://blog.mastek.com/topic/salesforce)
- [Gen AI (37)](https://blog.mastek.com/topic/gen-ai)
- [Oracle (36)](https://blog.mastek.com/topic/oracle)
- [Artificial Intelligence (34)](https://blog.mastek.com/topic/artificial-intelligence)
- [AI technologies (25)](https://blog.mastek.com/topic/ai-technologies)
- [Health Cloud (21)](https://blog.mastek.com/topic/health-cloud)
- [Retail (20)](https://blog.mastek.com/topic/retail)
- [Retail Tech (17)](https://blog.mastek.com/topic/retail-tech)
- [Cloud Technology (16)](https://blog.mastek.com/topic/cloud-technology)
- [thoughtleadership (14)](https://blog.mastek.com/topic/thoughtleadership)
- [Customer Experience (13)](https://blog.mastek.com/topic/customer-experience)
- [Managed Services (13)](https://blog.mastek.com/topic/managed-services)
- [Brand Champion (10)](https://blog.mastek.com/topic/brand-champion)
- [Cloud migration (10)](https://blog.mastek.com/topic/cloud-migration)
- [Ethical AI (10)](https://blog.mastek.com/topic/ethical-ai)
- [Passion club stories (10)](https://blog.mastek.com/topic/passion-club-stories)
- [leadership (10)](https://blog.mastek.com/topic/leadership)
- [IoT (9)](https://blog.mastek.com/topic/iot)
- [oracle HCM (9)](https://blog.mastek.com/topic/oracle-hcm)
- [Financial Services (8)](https://blog.mastek.com/topic/financial-services)
- [Public Sector (8)](https://blog.mastek.com/topic/public-sector)
- [RPA (8)](https://blog.mastek.com/topic/rpa)
- [UK Public Sector (8)](https://blog.mastek.com/topic/uk-public-sector)
- [data analysis (8)](https://blog.mastek.com/topic/data-analysis)
- [AI in Healthcare (7)](https://blog.mastek.com/topic/ai-in-healthcare)
- [Digital Service Design (7)](https://blog.mastek.com/topic/digital-service-design)
- [Oracle Cloud Application (7)](https://blog.mastek.com/topic/oracle-cloud-application)
- [Supply Chain (7)](https://blog.mastek.com/topic/supply-chain)
- [customer data platforms (7)](https://blog.mastek.com/topic/customer-data-platforms)
- [data governance (7)](https://blog.mastek.com/topic/data-governance)
- [data modernisation (7)](https://blog.mastek.com/topic/data-modernisation)
- [hcm (7)](https://blog.mastek.com/topic/hcm)
- [healthcare data (7)](https://blog.mastek.com/topic/healthcare-data)
- [Agile (6)](https://blog.mastek.com/topic/agile)
- [Business Process Automation (6)](https://blog.mastek.com/topic/business-process-automation)
- [Cloud Enhancement Services (6)](https://blog.mastek.com/topic/cloud-enhancement-services)
- [Cloud-based AI (6)](https://blog.mastek.com/topic/cloud-based-ai)
- [Government (6)](https://blog.mastek.com/topic/government)
- [ML (6)](https://blog.mastek.com/topic/ml)
- [Machine Learning (6)](https://blog.mastek.com/topic/machine-learning)
- [Manufacturing (6)](https://blog.mastek.com/topic/manufacturing)
- [Oracle ERP (6)](https://blog.mastek.com/topic/oracle-erp)
- [Oracle ERP Cloud (6)](https://blog.mastek.com/topic/oracle-erp-cloud)
- [data analytics (6)](https://blog.mastek.com/topic/data-analytics)
- [retail operations (6)](https://blog.mastek.com/topic/retail-operations)
- [Agentic AI (5)](https://blog.mastek.com/topic/agentic-ai)
- [Data Security (5)](https://blog.mastek.com/topic/data-security)
- [IT service management (ITSM) (5)](https://blog.mastek.com/topic/it-service-management-itsm)
- [Intelligent Automation (5)](https://blog.mastek.com/topic/intelligent-automation)
- [NHS (5)](https://blog.mastek.com/topic/nhs)
- [UK Central Government (5)](https://blog.mastek.com/topic/uk-central-government)
- [cybersecurity (5)](https://blog.mastek.com/topic/cybersecurity)
- [research (5)](https://blog.mastek.com/topic/research)
- [AI Strategy (4)](https://blog.mastek.com/topic/ai-strategy)
- [AI agents (4)](https://blog.mastek.com/topic/ai-agents)
- [AI and data (4)](https://blog.mastek.com/topic/ai-and-data)
- [CRM transformation (4)](https://blog.mastek.com/topic/crm-transformation)
- [Digital Workforce (4)](https://blog.mastek.com/topic/digital-workforce)
- [Digital commerce (4)](https://blog.mastek.com/topic/digital-commerce)
- [Future Tech (4)](https://blog.mastek.com/topic/future-tech)
- [Innovation (4)](https://blog.mastek.com/topic/innovation)
- [Intelligent Automation vs RPA (4)](https://blog.mastek.com/topic/intelligent-automation-vs-rpa)
- [Operational Resilience (4)](https://blog.mastek.com/topic/operational-resilience)
- [Oracle Partner (4)](https://blog.mastek.com/topic/oracle-partner)
- [Technology (4)](https://blog.mastek.com/topic/technology)
- [Testing (4)](https://blog.mastek.com/topic/testing)
- [Transformation (4)](https://blog.mastek.com/topic/transformation)
- [cloud implementation (4)](https://blog.mastek.com/topic/cloud-implementation)
- [data modernization (4)](https://blog.mastek.com/topic/data-modernization)
- [edge computing (4)](https://blog.mastek.com/topic/edge-computing)
- [erp cloud implementation (4)](https://blog.mastek.com/topic/erp-cloud-implementation)
- [higher education (4)](https://blog.mastek.com/topic/higher-education)
- [logistics (4)](https://blog.mastek.com/topic/logistics)
- [mortgages (4)](https://blog.mastek.com/topic/mortgages)
- [mulesoft (4)](https://blog.mastek.com/topic/mulesoft)
- [snowflake (4)](https://blog.mastek.com/topic/snowflake)
- [workplace (4)](https://blog.mastek.com/topic/workplace)
- [Compliance (3)](https://blog.mastek.com/topic/compliance)
- [Data management (3)](https://blog.mastek.com/topic/data-management)
- [Government Digital services (3)](https://blog.mastek.com/topic/government-digital-services)
- [Oracle SCM (3)](https://blog.mastek.com/topic/oracle-scm)
- [Passion Club (3)](https://blog.mastek.com/topic/passion-club)
- [RPA Implementation (3)](https://blog.mastek.com/topic/rpa-implementation)
- [Robotic Automation (3)](https://blog.mastek.com/topic/robotic-automation)
- [Salesforce Integration (3)](https://blog.mastek.com/topic/salesforce-integration)
- [Sustainability (3)](https://blog.mastek.com/topic/sustainability)
- [Transportation (3)](https://blog.mastek.com/topic/transportation)
- [UK ports (3)](https://blog.mastek.com/topic/uk-ports)
- [agentforce (3)](https://blog.mastek.com/topic/agentforce)
- [analytics (3)](https://blog.mastek.com/topic/analytics)
- [b2b (3)](https://blog.mastek.com/topic/b2b)
- [business outcomes (3)](https://blog.mastek.com/topic/business-outcomes)
- [cio (3)](https://blog.mastek.com/topic/cio)
- [consumer market (3)](https://blog.mastek.com/topic/consumer-market)
- [crm (3)](https://blog.mastek.com/topic/crm)
- [governance (3)](https://blog.mastek.com/topic/governance)
- [human resources (3)](https://blog.mastek.com/topic/human-resources)
- [intelligent parts assistant (3)](https://blog.mastek.com/topic/intelligent-parts-assistant)
- [metaverse (3)](https://blog.mastek.com/topic/metaverse)
- [microsoft (3)](https://blog.mastek.com/topic/microsoft)
- [strategy (3)](https://blog.mastek.com/topic/strategy)
- [work management (3)](https://blog.mastek.com/topic/work-management)
- [ADOPT (2)](https://blog.mastek.com/topic/adopt)
- [AI Agent Studio (2)](https://blog.mastek.com/topic/ai-agent-studio)
- [AIoT (2)](https://blog.mastek.com/topic/aiot)
- [AppDev (2)](https://blog.mastek.com/topic/appdev)
- [Automation Testing (2)](https://blog.mastek.com/topic/automation-testing)
- [Cloud Adoption (2)](https://blog.mastek.com/topic/cloud-adoption)
- [Customer Engagement (2)](https://blog.mastek.com/topic/customer-engagement)
- [Customer Insight (2)](https://blog.mastek.com/topic/customer-insight)
- [Data Science (2)](https://blog.mastek.com/topic/data-science)
- [DevOps culture (2)](https://blog.mastek.com/topic/devops-culture)
- [ESG (2)](https://blog.mastek.com/topic/esg)
- [GDPR (2)](https://blog.mastek.com/topic/gdpr)
- [Government Tech (2)](https://blog.mastek.com/topic/government-tech)
- [Higher Education Digital Transformation  (2)](https://blog.mastek.com/topic/higher-education-digital-transformation)
- [IIOT (2)](https://blog.mastek.com/topic/iiot)
- [Identity & Access Management (2)](https://blog.mastek.com/topic/identity-access-management)
- [Intelligent Automation tools (2)](https://blog.mastek.com/topic/intelligent-automation-tools)
- [Intelligent Process Automation (2)](https://blog.mastek.com/topic/intelligent-process-automation)
- [Mobile Testing (2)](https://blog.mastek.com/topic/mobile-testing)
- [Oracle Redwood (2)](https://blog.mastek.com/topic/oracle-redwood)
- [Project Management (2)](https://blog.mastek.com/topic/project-management)
- [SCM (2)](https://blog.mastek.com/topic/scm)
- [Security (2)](https://blog.mastek.com/topic/security)
- [UX (2)](https://blog.mastek.com/topic/ux)
- [automating systems and processes (2)](https://blog.mastek.com/topic/automating-systems-and-processes)
- [business acceleration (2)](https://blog.mastek.com/topic/business-acceleration)
- [business analysis (2)](https://blog.mastek.com/topic/business-analysis)
- [business uncertainty (2)](https://blog.mastek.com/topic/business-uncertainty)
- [cloud modernization (2)](https://blog.mastek.com/topic/cloud-modernization)
- [connected enterprise (2)](https://blog.mastek.com/topic/connected-enterprise)
- [data integration (2)](https://blog.mastek.com/topic/data-integration)
- [data migration (2)](https://blog.mastek.com/topic/data-migration)
- [data protection (2)](https://blog.mastek.com/topic/data-protection)
- [data quality (2)](https://blog.mastek.com/topic/data-quality)
- [data-driven intelligence (2)](https://blog.mastek.com/topic/data-driven-intelligence)
- [diversity and inclusion (2)](https://blog.mastek.com/topic/diversity-and-inclusion)
- [ecommmerce (2)](https://blog.mastek.com/topic/ecommmerce)
- [erp consultant (2)](https://blog.mastek.com/topic/erp-consultant)
- [ethics (2)](https://blog.mastek.com/topic/ethics)
- [post pandemic (2)](https://blog.mastek.com/topic/post-pandemic)
- [work from home (2)](https://blog.mastek.com/topic/work-from-home)
- [#DevSecOps #SecOps #IAST #DAST #SAST #RASP (1)](https://blog.mastek.com/topic/devsecops-secops-iast-dast-sast-rasp)
- [AI Algorithms (1)](https://blog.mastek.com/topic/ai-algorithms)
- [AI in the social sector (1)](https://blog.mastek.com/topic/ai-in-the-social-sector)
- [AIinFinance (1)](https://blog.mastek.com/topic/aiinfinance)
- [Agile BI (1)](https://blog.mastek.com/topic/agile-bi)
- [Agile Testing (1)](https://blog.mastek.com/topic/agile-testing)
- [Agile with GDS (1)](https://blog.mastek.com/topic/agile-with-gds)
- [AgileAI (1)](https://blog.mastek.com/topic/agileai)
- [Apex (1)](https://blog.mastek.com/topic/apex)
- [Automated Testing (1)](https://blog.mastek.com/topic/automated-testing)
- [Automation (1)](https://blog.mastek.com/topic/automation)
- [Awards (1)](https://blog.mastek.com/topic/awards)
- [BI (1)](https://blog.mastek.com/topic/bi)
- [Banking (1)](https://blog.mastek.com/topic/banking)
- [BizAnalytica (1)](https://blog.mastek.com/topic/bizanalytica)
- [Brexit (1)](https://blog.mastek.com/topic/brexit)
- [CEO Insight (1)](https://blog.mastek.com/topic/ceo-insight)
- [CISO (1)](https://blog.mastek.com/topic/ciso)
- [CSR (1)](https://blog.mastek.com/topic/csr)
- [Campus Technology Solutions (1)](https://blog.mastek.com/topic/campus-technology-solutions)
- [Chat Bots (1)](https://blog.mastek.com/topic/chat-bots)
- [Cognitive RPA (1)](https://blog.mastek.com/topic/cognitive-rpa)
- [Cognitive Technologies (1)](https://blog.mastek.com/topic/cognitive-technologies)
- [Compatibility Testing (1)](https://blog.mastek.com/topic/compatibility-testing)
- [Continous Delivery (1)](https://blog.mastek.com/topic/continous-delivery)
- [DART Framework (1)](https://blog.mastek.com/topic/dart-framework)
- [Data Storage (1)](https://blog.mastek.com/topic/data-storage)
- [Data Strategy (1)](https://blog.mastek.com/topic/data-strategy)
- [Data Virtualisation (1)](https://blog.mastek.com/topic/data-virtualisation)
- [Data Visualisation (1)](https://blog.mastek.com/topic/data-visualisation)
- [Data availability (1)](https://blog.mastek.com/topic/data-availability)
- [DataGenius (1)](https://blog.mastek.com/topic/datagenius)
- [DataOps (1)](https://blog.mastek.com/topic/dataops)
- [Databricks (1)](https://blog.mastek.com/topic/databricks)
- [Deep Learning (1)](https://blog.mastek.com/topic/deep-learning)
- [Delivery (1)](https://blog.mastek.com/topic/delivery)
- [DevSecOps (1)](https://blog.mastek.com/topic/devsecops)
- [Devact (1)](https://blog.mastek.com/topic/devact)
- [EPM Cloud (1)](https://blog.mastek.com/topic/epm-cloud)
- [EUSS (1)](https://blog.mastek.com/topic/euss)
- [Education (1)](https://blog.mastek.com/topic/education)
- [Engineering colleges in Mumbai (1)](https://blog.mastek.com/topic/engineering-colleges-in-mumbai)
- [FCCS (1)](https://blog.mastek.com/topic/fccs)
- [Financial Consolidation and Close (1)](https://blog.mastek.com/topic/financial-consolidation-and-close)
- [Graduate Programme (1)](https://blog.mastek.com/topic/graduate-programme)
- [IT consulting (1)](https://blog.mastek.com/topic/it-consulting)
- [Industry 4.0 (1)](https://blog.mastek.com/topic/industry-4-0)
- [Industry trends (1)](https://blog.mastek.com/topic/industry-trends)
- [Legal tech (1)](https://blog.mastek.com/topic/legal-tech)
- [Low-Code (1)](https://blog.mastek.com/topic/low-code)
- [MOT Framework (1)](https://blog.mastek.com/topic/mot-framework)
- [Mobile Content (1)](https://blog.mastek.com/topic/mobile-content)
- [Modern AI (1)](https://blog.mastek.com/topic/modern-ai)
- [Natural Language Processing (1)](https://blog.mastek.com/topic/natural-language-processing)
- [OCI (1)](https://blog.mastek.com/topic/oci)
- [Oracle Cloud Infrastructure (1)](https://blog.mastek.com/topic/oracle-cloud-infrastructure)
- [Oracle EPBCS (1)](https://blog.mastek.com/topic/oracle-epbcs)
- [Oracle Field Service Cloud (1)](https://blog.mastek.com/topic/oracle-field-service-cloud)
- [Oracle Fusion (1)](https://blog.mastek.com/topic/oracle-fusion)
- [Project Deep Blue (1)](https://blog.mastek.com/topic/project-deep-blue)
- [Real Time Location Solutions (1)](https://blog.mastek.com/topic/real-time-location-solutions)
- [Recovery Testing (1)](https://blog.mastek.com/topic/recovery-testing)
- [SAP ECC (1)](https://blog.mastek.com/topic/sap-ecc)
- [SLA (1)](https://blog.mastek.com/topic/sla)
- [Salesforce Lightning (1)](https://blog.mastek.com/topic/salesforce-lightning)
- [Scalability (1)](https://blog.mastek.com/topic/scalability)
- [Scaling AI (1)](https://blog.mastek.com/topic/scaling-ai)
- [Scattered Spider (1)](https://blog.mastek.com/topic/scattered-spider)
- [Semiconductor (1)](https://blog.mastek.com/topic/semiconductor)
- [Serverless Cloud Architectures (1)](https://blog.mastek.com/topic/serverless-cloud-architectures)
- [Service Management (1)](https://blog.mastek.com/topic/service-management)
- [Software engineering (1)](https://blog.mastek.com/topic/software-engineering)
- [Student Engagement Solutions (1)](https://blog.mastek.com/topic/student-engagement-solutions)
- [TIS (1)](https://blog.mastek.com/topic/tis)
- [TalentGenius (1)](https://blog.mastek.com/topic/talentgenius)
- [Tech consultant (1)](https://blog.mastek.com/topic/tech-consultant)
- [TechNovation (1)](https://blog.mastek.com/topic/technovation)
- [Test Maturity (1)](https://blog.mastek.com/topic/test-maturity)
- [Trends in Testing (1)](https://blog.mastek.com/topic/trends-in-testing)
- [UK retail (1)](https://blog.mastek.com/topic/uk-retail)
- [University Automation (1)](https://blog.mastek.com/topic/university-automation)
- [Workers Compensation (1)](https://blog.mastek.com/topic/workers-compensation)
- [XLA (1)](https://blog.mastek.com/topic/xla)
- [analytics practice (1)](https://blog.mastek.com/topic/analytics-practice)
- [aws (1)](https://blog.mastek.com/topic/aws)
- [azure (1)](https://blog.mastek.com/topic/azure)
- [biometrics (1)](https://blog.mastek.com/topic/biometrics)
- [branding (1)](https://blog.mastek.com/topic/branding)
- [careers decomplexed (1)](https://blog.mastek.com/topic/careers-decomplexed)
- [change (1)](https://blog.mastek.com/topic/change)
- [claude (1)](https://blog.mastek.com/topic/claude)
- [contract management (1)](https://blog.mastek.com/topic/contract-management)
- [data modelling (1)](https://blog.mastek.com/topic/data-modelling)
- [data table (1)](https://blog.mastek.com/topic/data-table)
- [decomplexify (1)](https://blog.mastek.com/topic/decomplexify)
- [development (1)](https://blog.mastek.com/topic/development)
- [employee engagement (1)](https://blog.mastek.com/topic/employee-engagement)
- [employee experience (1)](https://blog.mastek.com/topic/employee-experience)
- [financial crime (1)](https://blog.mastek.com/topic/financial-crime)
- [industrial iot (1)](https://blog.mastek.com/topic/industrial-iot)
- [inhouse (1)](https://blog.mastek.com/topic/inhouse)
- [intelligent job connect (1)](https://blog.mastek.com/topic/intelligent-job-connect)
- [inventory management (1)](https://blog.mastek.com/topic/inventory-management)
- [jobconnect (1)](https://blog.mastek.com/topic/jobconnect)
- [legal (1)](https://blog.mastek.com/topic/legal)
- [life sciences (1)](https://blog.mastek.com/topic/life-sciences)
- [magento (1)](https://blog.mastek.com/topic/magento)
- [managed service partner (1)](https://blog.mastek.com/topic/managed-service-partner)
- [marketing (1)](https://blog.mastek.com/topic/marketing)
- [outsource (1)](https://blog.mastek.com/topic/outsource)
- [outsystems (1)](https://blog.mastek.com/topic/outsystems)
- [planning and budgeting (1)](https://blog.mastek.com/topic/planning-and-budgeting)
- [predective analytics (1)](https://blog.mastek.com/topic/predective-analytics)
- [productivity (1)](https://blog.mastek.com/topic/productivity)
- [provider (1)](https://blog.mastek.com/topic/provider)
- [public safety (1)](https://blog.mastek.com/topic/public-safety)
- [talent acquisition (1)](https://blog.mastek.com/topic/talent-acquisition)
- [testing partnership (1)](https://blog.mastek.com/topic/testing-partnership)
- [time management (1)](https://blog.mastek.com/topic/time-management)
- [user experience (1)](https://blog.mastek.com/topic/user-experience)
- [zero touch operations (1)](https://blog.mastek.com/topic/zero-touch-operations)

see all

### Recent Posts

[![](https://www.mastek.com/wp-content/uploads/assets/icons/mastek-footer-logo.svg)](https://www.mastek.com/)

- [![](https://www.mastek.com/wp-content/uploads/assets/icons/fb.svg)](https://www.facebook.com/Mastekltd/)
- [![](https://www.mastek.com/wp-content/uploads/assets/icons/insta.svg)](https://www.instagram.com/mastekltd/)
- [![](https://www.mastek.com/wp-content/uploads/assets/icons/x.svg)](https://x.com/Mastekltd)
- [![](https://www.mastek.com/wp-content/uploads/assets/icons/in.svg)](https://www.linkedin.com/company/mastek/)
- [![](https://www.mastek.com/wp-content/uploads/assets/icons/yt.svg)](https://www.youtube.com/channel/UCu-jUvZhjNtw_eNBKKLossA)

Services

- [Mastek AI](https://www.mastek.com/ai/)
- [Digital Engineering & Experience](https://www.mastek.com/services/digital-engineering-and-experience/)
- [Data and AI Services](https://www.mastek.com/services/data-automation-and-ai/)
- [Oracle Cloud](https://www.mastek.com/services/oracle/)
- [Salesforce](https://www.mastek.com/services/salesforce/)
- [Managed Services](https://www.mastek.com/services/cloud-managed-services/)
- [Cybersecurity](https://www.mastek.com/services/cybersecurity/)

Industries

- [Healthcare](https://www.mastek.com/industries/healthcare/)
- [Life Sciences](https://www.mastek.com/industries/life-sciences/)
- [Retail & Consumer](https://www.mastek.com/industries/retail/)
- [Manufacturing & Technology](https://www.mastek.com/industries/manufacturing/)
- [Financial Services](https://www.mastek.com/industries/financial-services/)
- [Higher Education](https://www.mastek.com/industries/higher-education/)

Company

- [About Mastek](https://www.mastek.com/about-us/)
- [Leadership](https://www.mastek.com/leadership/)
- [Investors](https://www.mastek.com/investors/)
- [Careers](https://www.mastek.com/careers/)
- [DEIB](https://www.mastek.com/careers/diversity-inclusion/)
- [Our Story](https://www.mastek.com/our-story/)
- [ESG](https://www.mastek.com/esg/)
- [ReShine](https://www.mastek.com/reshine/)

Insights

- [Blog](https://blog.mastek.com/)
- [Glossary](https://www.mastek.com/glossary/)
- [Press Releases](https://www.mastek.com/press-releases/)
- [News](https://www.mastek.com/news-list/)
- [Resources](https://www.mastek.com/resources-list/)
- [Webinars & Events](https://www.mastek.com/events/)
- [Podcast](https://www.mastek.com/podcast/)

## Services

- [Mastek AI](https://www.mastek.com/ai/)
- [Digital Engineering & Experience](https://www.mastek.com/services/digital-engineering-and-experience/)
- [Data and AI Services](https://www.mastek.com/services/data-automation-and-ai/)
- [Oracle Cloud](https://www.mastek.com/services/oracle/)
- [Salesforce](https://www.mastek.com/services/salesforce/)
- [Managed Services](https://www.mastek.com/services/cloud-managed-services/)

## Industries

- [Public Sector & Government](https://www.mastek.com/industries/public-sector-government/)
- [Healthcare & Life Sciences](https://www.mastek.com/industries/healthcare-life-sciences/)
- [Retail & Consumer](https://www.mastek.com/industries/retail/)
- [Manufacturing & Technology](https://www.mastek.com/industries/manufacturing/)
- [Financial Services](https://www.mastek.com/industries/financial-services/)
- [Higher Education](https://www.mastek.com/industries/higher-education/)

## Company

- [About Mastek](https://www.mastek.com/about-us/)
- [Leadership](https://www.mastek.com/leadership/)
- [Investors](https://www.mastek.com/investors/)
- [Careers](https://www.mastek.com/careers/)
- [Our Story](https://www.mastek.com/our-story/)
- [ESG](https://www.mastek.com/esg/)
- [ReShine](https://www.mastek.com/reshine/)

## Insights

- [Blog](https://blog.mastek.com/)
- [Glossary](https://www.mastek.com/glossary/)
- [Press Releases](https://www.mastek.com/press-releases/)
- [News](https://www.mastek.com/news-list/)
- [Resources](https://www.mastek.com/resources-list/)
- [Webinars & Events](https://www.mastek.com/events/)
- [Podcast](https://www.mastek.com/podcast/)

© Mastek, 2026. All rights reserved.

[Cookie Policy](https://www.mastek.com/cookie-policy/) | [Privacy Notice](https://www.mastek.com/privacy-notice/) | [Statutory Compliance](https://www.mastek.com/statutory-compliance/)

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blog.mastek.com/soql-aggregate-functions-in-apex#article",
  "@type" : "Article",
  "about" : [ "Apex" ],
  "articleSection" : "Apex",
  "author" : {
    "@type" : "Person",
    "name" : "Karthikeyan Mohandoss"
  },
  "dateModified" : "2026-10-03T07:23:44+0000",
  "datePublished" : "2023-03-13T06:40:58+0000",
  "description" : "SOQL Aggregate functions in salesforce include AVG(), COUNT() , MIN() , MAX(), SUM().It allows to rollup and summarize data in a query.",
  "headline" : "SOQL Aggregate functions in Apex",
  "image" : {
    "@type" : "ImageObject",
    "url" : "https://501686.fs1.hubspotusercontent-na1.net/hubfs/501686/operationalResilience-Blog.jpg"
  },
  "inLanguage" : "en",
  "keywords" : [ "Apex" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.mastek.com/soql-aggregate-functions-in-apex",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://www.mastek.com/wp-content/uploads/assets/icons/Mastek-logo.svg"
    },
    "name" : "Mastek",
    "url" : "https://www.mastek.com"
  },
  "url" : "https://blog.mastek.com/soql-aggregate-functions-in-apex"
}
```