set @csum := 0;
SELECT temp.*,(@csum := total + @csum) as csums from (
select count(1) as total,month(openedDate) as date from zt_bug where openedDate >= CONCAT(YEAR(NOW()), '-01-01 00:00:01') and `status` <> 'closed' GROUP BY date
)as temp

参考:https://blog.csdn.net/qcyfred/article/details/78045857

 

posted on 2018-12-04 16:16  蛋尼  阅读(582)  评论(0编辑  收藏  举报