Using GROUP BY with aggregate functions
A GROUP BY clause almost always appears in statements that include aggregate functions, in which case the aggregate produces
a value for each group. These values are called vector aggregates. (A scalar aggregate is a single value produced by an aggregate function without a GROUP BY clause.)
Example
The following query lists the average price of each kind of product:
The vector aggregates produced by SELECT statements with aggregates and a GROUP BY appear as columns in each row of the results.
By contrast, the scalar aggregates)produced by queries with aggregates and no GROUP BY also appear as columns, but with only
one row. For example: