sql 查询每天数据
date 为时间字段名
account_record为表名
where条件为查询当月数据的条件
SELECT SUBSTRING(date,1,10) as day, COUNT(date) as num FROM `account_record` WHERE SUBSTRING(date,1,7)=SUBSTRING('2022-02-18',1,7) GROUP BY SUBSTRING(date,1,10) ORDER BY date desc;
date 为时间字段名
account_record为表名
where条件为查询当月数据的条件
SELECT SUBSTRING(date,1,10) as day, COUNT(date) as num FROM `account_record` WHERE SUBSTRING(date,1,7)=SUBSTRING('2022-02-18',1,7) GROUP BY SUBSTRING(date,1,10) ORDER BY date desc;