说明:一下是自定义7天为一个时间段的分组统计

 

select datediff(ms_time, '开始时间') div 7 as time , count(*) count,sum(money) money
from merchant_statistics
WHERE ms_time BETWEEN '2019-02-02' and '2019-03-02'
group by (datediff(ms_time, '开始时间') div 7)

posted on 2019-04-23 14:31  Superb1995  阅读(1040)  评论(0编辑  收藏  举报