Aggregate Functions

Note: All functions in this section that have an analytic function counterpart are appended with [Aggregate] to avoid confusion between the two.

Aggregate functions summarize data over groups of rows from a query result set. The groups are specified using the GROUP BY clause. They are allowed only in the select list and in the HAVING and ORDER BY clauses of a SELECT statement (as described in Aggregate Expressions).

Notes

You can also use some of the simple aggregate functions as analytic (window) functions. See Analytic Functions for details. See also SQL Analytics in Analyzing Data.

In This Section