日期:2014-05-18 浏览次数:20568 次
--按月求和 select month(created_date) as month,sum(amount),sum(quan) from tb group by month(created_date)
------解决方案--------------------
--应该把年份也考虑进来吧,如果不用那么2楼就是对的了 select year(created_date) as year,month(created_date) as month,sum(amount),sum(quan) from tb group by year(created_date),month(created_date)