表a:id,name,days,money,time
select sum(days) days from a where money<>0
如何把我上面sql语句查出来的数据按照月份分组统计
------解决思路----------------------
select MONTH(time)[month],sum(days) days from a where money<>0 GROUP BY MONTH(time)
不知道是不是这个意思
select MONTH(time)[month],sum(days) days from a where money<>0 GROUP BY MONTH(time)