sql 语句 存在字段是日期 如何统计每月数据

2025-05-08 21:06:50
推荐回答(1个)
回答1:

select sum(数据) from 表名 where year(日期字段名)=某年group by datepart(month,日期字段名)