MySQL GROUPBY Clause
The MYSQL GROUPBY Clause used to collect data from multiple records and group the result by one or more column. It is generally used in a SELECT statement.
MySQL GROUPBY Syntax
SELECT expression1, expression2, ... expression_n, aggregate_function (expression) FROM tables [WHERE conditions] GROUP BY expression1, expression2, ... expression_n;