Your Library
Chapter 5 · Aggregation and COUNTSummarize rows into useful measures and groups
Contents
Chapter 4

Aggregation and COUNT

Summarize rows into useful measures and groups

Filtering answers questions about individual rows. Aggregation answers questions about collections of rows: totals, averages, ranges, and counts. This chapter introduces aggregate functions, GROUP BY, HAVING, and the important differences between COUNT(*) and counting a column.

Examples use broadly supported SQL. Schema details such as indexes and enum types vary by database; those cases are labeled. Grouped results have no guaranteed display order unless the query includes ORDER BY.

In this chapter

  1. 4.1Aggregation and COUNT