📜  mysql sum with group by - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:22.741000             🧑  作者: Mango

代码示例1
-- Sum Columns only show up in SELECT statement 
-- All other columns must be in both
SELECT categories_column, SUM(units_column) AS total_units
FROM schema.table
GROUP BY categories_column;