mysql DATE_SUB函数用法

select a.id vehid,a.PlateNumber platenumber from t_base_vehicle a inner join t_base_vehicle_location b on a.SN=b.sn 

where a.status=17 and a.modifyDate <DATE_SUB(NOW(),INTERVAL 20 MINUTE) --当前时间减20分钟

AND a.id not in(select vehicleId from t_base_task where (taskStatus!=4) 

AND isdelete=0 AND tasktype=0 AND createDate>DATE_SUB(NOW(),INTERVAL 48 HOUR))--当前时间减去2天

posted @ 2017-12-13 16:58  JLCUI  阅读(396)  评论(0编辑  收藏  举报