Group by columns
You can group rows by one or more columns with the help of the GROUP_BY() function.
Group by one column.
Group by two columns.
For example, if in the GROUP_BY() function you specified "warehouse" as the column to group by:
The grouped column name in the resulting frame defaults to "by_warehouse".
To change the default name of the grouped column to "count", use