110,571
社区成员
发帖
与我相关
我的任务
分享
SELECT CONVERT(VARCHAR(7),time,23) AS d,SUM(num) AS c FROM table GROUP BY CONVERT(VARCHAR(7),time,23)
ORDER BY d DESC
select cast(year(time)+'-'+month(time) as datetime) as d,sum(num) as c from table group by cast(year(time)+'-'+month(time) as datetime) order by cast(year(time)+'-'+month(time) as datetime) desc