--根据日期字段AddTime,得到每日的数据量 SELECT CAST(AddTime AS DATE) AS riqi, COUNT(*) AS TotalOrders FROM MoJingKaKouRecord GROUP BY CAST(AddTime AS DATE) order by riqi desc
--统计出每日的车牌数量(同一个车牌,同一天只算一次) select riqi,count(*) as num from ( SELECT CAST(AddTime AS DATE) AS riqi, COUNT(*) AS TotalOrders FROM MoJingKaKouRecord GROUP BY CAST(AddTime AS DATE),PlateNo ) as t1 group by riqi order by riqi desc
--指定时间范围内的车牌总数(每个车牌每日只统计一次) select sum(num) from ( select riqi,count(*) as num from ( SELECT CAST(AddTime AS DATE) AS riqi, COUNT(*) AS num FROM MoJingKaKouRecord GROUP BY CAST(AddTime AS DATE),PlateNo ) as t1 group by riqi ) as t2 where riqi >='2024-9-1' and riqi <'2024-10-1'