如何才能获得与我的价值相距特定日期的所有结果?

时间:2023-01-14 13:56:20

Using php i want to make the following mysql query

使用php我想进行以下mysql查询

SELECT * FROM TABLE WHERE AUTODATE > (24HRS DIFFERENCE FROM CURRENT DATE)

the AUTODATE var CURRENT_TIMESTAMP has values in format Y-m-d H:i:s

AUTODATE var CURRENT_TIMESTAMP的格式为Y-m-d H:i:s

How is that possible?

怎么可能?

2 个解决方案

#1


You might want

你可能想要

SELECT ... WHERE yourDateField > Curdate() - Interval 1 day
or maybe
SELECT ... WHERE yourDateField > Now() - Interval 24 hour

#2


WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= autodate;

read the manual.

阅读手册。

#1


You might want

你可能想要

SELECT ... WHERE yourDateField > Curdate() - Interval 1 day
or maybe
SELECT ... WHERE yourDateField > Now() - Interval 24 hour

#2


WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= autodate;

read the manual.

阅读手册。