Last updated 4 years ago
Was this helpful?
很多时候需要查询当前时间之前的时间到当前的数据,可以通过mysql的 data_sub 函数来设置一个间隔时间获得:
data_sub
select * from test_table where count_time > date_sub(now(), interval 1 minute) ;
以上查询就是 test_table 的 count_time 字段中,一分钟以内数据查询。
test_table
count_time