MySQL Group by SUM

SELECT cat_name, SUM(amount) AS total_amount
FROM table
GROUP BY cat_name

Leave a Comment