12. Simple Totals

“There are two kinds ofstatistics: the kind you look upand the kind you make up.”

—Rex StoutDeath of a Doxy:A Nero Wolfe Novel

Topics Covered in This Chapter

Aggregate Functions

Using Aggregate Functions in Filters

Sample Statements


Problems for You to Solve

You now know how to select the columns you need for a given request, define expressions that add extra levels of detail, join the appropriate tables that supply the columns you require, and define conditions to filter the data sent to the result set. We’ve shown you all these techniques so that you can learn how to retrieve detailed information from one or more tables in the database. In this and the next two chapters, we’ll show you how to take a step back and look ...

Get SQL Queries for Mere Mortals®: A Hands-On Guide to Data Manipulation in SQL, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.