GROUP BY

The GROUP BY clause retrieves a set of summary data. Instead of retrieving the data itself, GROUP BY groups the data and summarizes each group with an SQL aggregate function. The server returns only the summarization information for each group to Crystal Reports.

For example:

SELECT
     MYTABLE.'STATE',
     MYTABLE.'ZIPCODE',
     SUM (MYTABLE.'SALES')
FROM
     'MYTABLE' MYTABLE
GROUP BY
     MYTABLE.'STATE',
     MYTABLE.'ZIPCODE'