Construction should include applying a GROUP BY clause in a query that uses a group function in the SELECT statement.
- Any column defined in the SELECT clause where a group function is used, that is NOT a group function, must be present in the GROUP BY clause.
- The GROUP BY clause will produce sub-totals on the field defined to group by.