Grouping data
If you use aggregate functions, such SUM or AVG, you typically have to group the results by one or more columns. For example, an Orders table contains order records and some customers have multiple orders. To get the order totals for each customer, you would use the GROUP BY clause to group the customers, and the SUM function to aggregate the order totals by customer.
How to group data
Under Column, click in an empty row. Click the arrow button, and select the column whose aggregate data to group. Figure 2-8 shows an example in which results are grouped on the CUSTOMERNAME column.
Figure 2-8  
The following GROUP BY clause is added to the SELECT statement:

Additional Links:

Copyright Actuate Corporation 2012