Aggregate functions group rows and provide summary information about those rows, depending on the function used. Common function calls are count(), sum(), avg(), min(), and max().

NOTE: Xactly has extended and streamlined SQL-92’s syntax for aggregate functions. While GROUP BY, ORDER BY, and HAVING clauses are supported, GROUP BY is optional, as are the other two in many cases, depending on the SQL statement’s requirements.

In this exercise, we’ll use count() and min() to analyze data about order stages:

1 SQL> select batch_name, count(*), min(incentive_date) from xactly.xc_order_stage;

Screen Shot 2016-06-06 at 10.20.36 AM