Sometimes the information you want can only be derived from data in a set of rows, instead of individual rows.
Aggregate functions produce results from sets of relational data that you have grouped (optionally) using a GROUP BY or ORDER BY clause. Aggregate functions process each set and produce one result for each set.
The following table lists a few examples of aggregate functions.
The function… | Returns the… |
---|---|
AVG | arithmetic average of the values in a specified column. |
COUNT | number of qualified rows. |
MAX | maximum column value for the specified column. |
MIN | minimum column value for the specified column. |
SUM | arithmetic sum of a specified column. |