Summary

Today you learned to use aggregate functions to get information about a set of rows in a single row or a grouped result. Aggregates are among the most powerful and frequently used tools in Transact-SQL.

You've seen the power and flexibility of the SELECT statement extended significantly in this lesson. With grouping, ROLLUP, and CUBE, you can get grouped and totaled data. In combination with the CASE operator, you've learned to build pivot tables to deliver data in a useful format.

What all these techniques share is the capability to condense vast amounts of data into a compact result. Whenever possible, use SQL Server aggregates to reduce the size of result sets. This will improve network efficiency, reduce the work required by client ...

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.