GROUP BY clause of SELECT
The GROUP BY clause of a SELECT statement specifies which columns are to be used for grouping the rows in the result table.
The sequence of the columns in the GROUP BY clause specifies the sequence the rows will be grouped by in the result table. This means that the result table will first be grouped by the first column in the GROUP BY clause, then within that grouping the result table will be grouped by the second column in the GROUP BY clause, and so on.
The GROUP BY clause is optional. If if is not specified, the entire result table will be considered one group.
Last modified date: 01/29/2015