13. Grouping Data
“Don’t drown yourself with details.Look at the whole.”
—Marshal Ferdinand Foch
Commander-in-Chief, Allied armies in France
Topics Covered in This Chapter |
|
Chapter 12, Simple Totals, explained how to use the aggregate functions (COUNT, MIN, MAX, AVG, and SUM) to ask SQL to calculate a value across all the rows in the table defined in your FROM and WHERE clauses. We pointed out, however, that after you include any value expression that contains an aggregate function in your SELECT clause, all your value expressions must either be a literal constant or contain an aggregate function. This characteristic ...
Get SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 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.