MySQL 截至每天累计数据统计

查询结果

查询语句

select tDailyCount.ddate, tDailyCount.count, @dailycount := @dailycount + tDailyCount.count as scount from 
  (select tTable.dd as ddate,count(*) as count from 
    (SELECT jira_key, min(date_format(time, '%Y-%m-%d')) as dd FROM sonic.result_summary group by jira_key) as tTable 
  group by ddate) as tDailyCount, (select @dailycount := 0) AS tTemp;

猜你喜欢

转载自blog.csdn.net/weixin_41693437/article/details/133036383
今日推荐