MariaDB GROUP BY: COUNT, SUM, HAVING, Month, Week and GROUP_CONCAT
If you need one row per state with an order count and a dollar total, MariaDB GROUP BY is the clause: SELECT state, COUNT(*), SUM(amount) FROM orders GROUP BY state; collapses every matching row into one. The hard parts sit around it: HAVING versus WHERE, a DATETIME grouped by month, and a default sql_mode that … Read more >>