sql查询某几天内相差多少秒数据
SELECT * from tablename where TIMESTAMPDIFF(SECOND,time1,time2)>100 AND DATE_SUB(CURDATE(), INTERVAL 2 DAY) <= date(time2)
SELECT * from comp_fast_task where TIMESTAMPDIFF(SECOND,comp_fast_task.ksbdsj,comp_fast_task.wcbdsj)>100 AND DATE_FORMAT(comp_fast_task.wcbdsj, '%Y-%m-%d') = '2021-01-12'