introducing group by
Suppose there was a functional requirement to : display a list of route types The following code could be used
select routetype from route
The results would show multiple copies of the same value.
The group by clause gathers together rows with identical values and returns them as a single group (row)
select routetype from route
group by routetype
So the two coastal values and the two forest values are combined to form a single group (row) for each.
Notice 4 rows are returned rather than 6.
Using group by is a way of displaying the unique values in a column
Using group by
Display a list of the unique rating values