MySQL 使用SUM函数分组

示例

SELECT product, SUM(quantity) AS "Total quantity"
FROM order_details
GROUP BY product;