mysql 累加求和

小灰灰 2023-06-02 07:41 44阅读 0赞
  1. set @csum := 0;
  2. SELECT temp.*,(@csum := total + @csum) as csums from (
  3. 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
  4. )as temp

1078922-20181204161516963-2128657982.png

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

转载于:https://www.cnblogs.com/dannyyao/p/10064794.html

发表评论

表情:
评论列表 (有 0 条评论,44人围观)

还没有评论,来说两句吧...

相关阅读