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 查询:
SELECT .... WHERE CalendarDateTime.StartDate >= NOW()
我怎样才能将NOW()零件更改为昨天的参考?
NOW()
SELECT .... WHERE CalendarDateTime.StartDate >= NOW() - INTERVAL 1 DAY
但我想StartDate是一个日期,而您真正想要的是包括今天的事件,您当前的解决方案仅在午夜执行。在这种情况下,更合适的解决方案是:
StartDate
SELECT .... WHERE CalendarDateTime.StartDate >= DATE(NOW())