14. Filtering Grouped Data

“Let schoolmasters puzzle their brain,With grammar, and nonsense, and learning;Good liquor, I stoutly maintain,Gives genius a better discerning.”

—Oliver Goldsmith

Topics Covered in This Chapter

A New Meaning of “Focus Groups”

Where You Filter Makes a Difference

Uses for HAVING

Sample Statements

Summary

Problems for You to Solve

In Chapter 12, “Simple Totals,” we gave you the details about all the aggregate functions defined in the SQL Standard. We followed that up in Chapter 13, “Grouping Data,” with a discussion of how to ask your database system to group sets of rows and then calculate aggregate values on each group. One of the advantages to grouping is that you can also display value expressions based on the grouping ...

Get SQL Queries for Mere Mortals®: A Hands-On Guide to Data Manipulation in SQL, Third 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.