MySQL 截至每天累计数据统计

查询结果

MySQL 截至每天累计数据统计_第1张图片

查询语句

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;

你可能感兴趣的:(后台开发,mysql,数据库)