统计最近7天的数据(统计)
查询数据库表中最近7天的记录(用于做统计)
MySQL 代码
select date_format(a.date,'%c.%d') day,b.count,b.amount
from (
SELECT curdate() as date
union all
SELECT date_sub(curdate(), interval 1 day) as date
union all
SELECT date_sub(curdate(), interval 2 day) as date
union all
SELE
原创
2020-08-19 11:47:46 ·
2371 阅读 ·
0 评论