标签: sql
我需要关注输出
答案 0 :(得分:1)
假设RDBMS为mysql; 假设表结构如下;
mysql
create table tbl(date_clm date, item int);
查询:
select DATE_FORMAT(date_clm, '(%m)%Y') as Month_Year, sum(item) as items from tbl group by Month_Year;