sql将数据按月汇总显示

select datepart(year,date),datepart(month,date),sum(需要合计的数据项) from

group by datepart(year,date),datepart(month,date) order by datepart(year,date),datepart(month,date)

你可能感兴趣的:(sql,数据库,server,职场,休闲)