9. Summarizing Data
Keywords Introduced
DISTINCT • SUM • AVG • MIN • MAX • COUNT • GROUP BY • HAVING • ROW_NUMBER • RANK • DENSE RANK • NTILE • OVER • PARTITION BY
Up until now, all of the calculations, functions, and CASE expressions we’ve used have only altered the values of individual columns. The rows we’ve retrieved have corresponded to rows in tables in the underlying database. We now want to turn to various methods of summarizing data, by combining values in multiple rows.
The computer term usually associated with this type of endeavor is aggregation, which means “to combine into groups.” The ability to aggregate and summarize data is key to being able to move beyond a mere display of data to something approaching ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access