在规定的时间范围类,按月统计数据
在规定的时间范围类,按月统计数据
select count(*) as c, year(gm_time) as year_gt, month(gm_time) as month_gt from gps_msg_8613500135001 where gm_cmd <> 0 and CONVERT_TZ(gm_time,'+00:00','+0:0') >= STR_TO_DATE( '2010-01-02', '%Y-%m-%d %H:%i:%s') and CONVERT_TZ(gm_time,'+00:00','+0:0') <= STR_TO_DATE( '2010-08-12 23:59:59', '%Y-%m-%d %H:%i:%s') group by year(gm_time), month(gm_time)