Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个 SQL 查询:
where datetime < DATE_ADD(DATE(now()), INTERVAL 15 DAY) order by datetime ASC
这是说明日期时间在 15 天或更早之前在哪里的正确查询吗?
您应该改用 DATE_SUB:
where datetime < DATE_SUB(DATE(now()), INTERVAL 15 DAY) order by datetime ASC
有关文档,请参见此处。