Computing Group Values

The SELECT command can be used to compute values for groups of records. These values consist of sums, averages, counts, maximum values, minimum values, standard deviations, and variances. Groups are based on common values in a column(s).

In order to understand groups, we can begin by looking at Table 5.1. It holds tool purchase records. The Employee column contains several records with the same value.

Table 5.2 displays the virtual records that would be created by grouping the records displayed in Table 5.1. The grouping is based on common values in the Employee column. When records are grouped, one virtual record is created for each distinct group value.

Table 5.2 also displays the group values that are computed for each ...

Get Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts 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.