更新时间:2021-09-25 02:31:25
Date
是 Date_add()
函数.BETWEEN low-value AND high-value
比较运算符,以获取指定范围内的值.Date
is a Keyword in MySQL. You should really avoid using it as a table/column name.INTERVAL -1 HOUR
to current time (NOW()
), using Date_add()
function.BETWEEN low-value AND high-value
comparison operator, to get the values from the prescribed range.尝试以下查询:
SELECT *
FROM sample.writing
where Date BETWEEN DATE_ADD(NOW(), INTERVAL -1 HOUR) AND NOW()