January 2019
Beginner
556 pages
14h 19m
English
The GROUP BY clause is used for grouping. Grouping means splitting the whole input set of records into several groups, with a view to having only one result row for each group. Grouping is performed on the basis of a list of expressions. All records that have the same combination of values of grouping expressions are grouped together. This means that the groups are identified by the values of expressions defined in the GROUP BY clause. Usually, it makes sense to include these expressions in the SELECT-list to indicate which group is represented by the result row.
For example, let's group the cars by make and model and select the groups:
car_portal=> SELECT make, model FROM car_portal_app.car a INNER JOIN car_portal_app.car_model ...
Read now
Unlock full access