MySQL SUM() function retrieves the sum value of an expression which has undergone a grouping operation by GROUP BY clause.
SELECT cate_id,SUM(total_cost)
FROM purchase
GROUP BY cate_id;
MySQL SUM() function retrieves the sum value of an expression which has undergone a grouping operation by GROUP BY clause.
SELECT cate_id,SUM(total_cost)
FROM purchase
GROUP BY cate_id;