mysql group by aggregate code example
Example 1: MySQL GROUP BY
SELECT
c1, c2,..., cn, aggregate_function(ci)
FROM
table
WHERE
where_conditions
GROUP BY c1 , c2,...,cn;
Example 2: MySQL GROUP BY
SELECT Manufacturer, COUNT(*) AS ModelsCount
FROM Products
WHERE Price > 30000
GROUP BY Manufacturer
ORDER BY ModelsCount DESC
Example 3: mysql grouping functions
MySQL Grouping Functions
AVG
MAX
BIT_AND
STD
BIT_OR
STDDEV
COUNT
SUM
GROUP_CONCAT
VARIANCE
MIN