表格显示车牌号,显示时间,摄像头位置。我需要找到每周出现不止一次的汽车,我需要知道他们是谁,每周的出现频率,以及满足条件的汽车总数。
我试图手动分割时间段,但这太低效了。我尝试了以下查询:
SELECT *,
Variance(Time_to_sec(time)),
Count(*)
FROM trafficdata.anpr_in
WHERE location = 'a35.1.ob.1'
AND Date(time) BETWEEN '2012-05-09'AND '2012-05-15'
AND Time(time) BETWEEN '07:00:00' AND '07:05:00'
GROUP BY plate
HAVING ( Count(plate) > 3 );
输入表如下所示:
plate location number time
T971JUR A3024.7.IB.1 96 2012-05-13 18:06:17
HN52YWE A3024.13.OB.1 94 2012-05-13 18:09:53