The GROUP BY clause in a SELECT statement groups rows that share the same values in one or more columns. It appears after the WHERE clause and before the ORDER BY clause.
You can use GROUP BY with aggregate functions, such as SUM, COUNT, or AVG, to return summarized data. Each group in the result set is represented by a single row.
You can create and manage the GROUP BY clause on the Group By tab of Tabbed Editor. The clause structure is organized into three boxes: Columns, Grouped By, and Expression.
To open Tabbed Editor, do one of the following:
In the top menu, select Query > Show Tabbed Editor.
On the Query toolbar, click
.
1. In the Columns box, select the columns to group data by, then click
. This moves columns to the Grouped By box.
2. To reorder multiple columns, in the Grouped By box, use
and
.
Tip
To remove a column from the Grouped By box, select it, then click
.
3. To group by a calculated value, in the Expression box, click
. The expression appears in the Grouped By box.

4. Optional: To preview the query, click Text in the bottom panel of the Query Builder document.
Note
All columns in the SELECT list must also appear in the
GROUP BYclause – unless they’re used only within an aggregate function.