Chapter 3: Using Aggregates, Grouping, and Sorting

This chapter addresses the sum, avg, count, count(*), max, and min aggregate functions that enable you to summarize the data retrieved in a query. This chapter also discusses how to organize data into categories and subgroups using the group by, having, and order by clauses. Two Transact-SQL extensions—the compute clause and the union operator, are also discussed.

If your Adaptive Server is not case sensitive, see group by and having Clauses and compute Clause in the Reference Manual for examples on how case sensitivity affects the data returned by these clauses.