Chapter 8


In this chapter we will discuss how to use aggregation, grouping, and the HAVING clause in a SELECT. By using these added features, we can group data of a particular type, filter the output with HAVING, and do combinations of aggregate calculations (such as sums, averages, and counts). We will also take another look at nulls.

Aggregates/Column Functions

As we discussed in Chapter 4, an aggregate (or group) function is one that extracts information — such as a COUNT of rows in a table. We can also find an average, minimum, or maximum for some column by operating on multiple rows. Some examples are:


We can now proceed ...

Get Practical Guide to using SQL in Oracle now with the O’Reilly learning platform.

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