thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Business Platforms & EA · Intermediate

Aggregate Query

SOQL query using functions such as COUNT, SUM, AVG, MIN and MAX with GROUP BY, returning AggregateResult objects.

Definition

Aggregate queries support HAVING and grouping; each row aggregated still counts toward the query row limit.

Example

SELECT StageName, SUM(Amount) total FROM Opportunity GROUP BY StageName

Exam tip

AggregateResult values are accessed with get('alias').

Related terms