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.
其实我想问一个简单的问题!我有一个名为events的表,主要字段为 ( 'name','creation_date','ending_date' )。现在我想做的是,获取今天日期和到期日期之间的所有事件。谁能帮我解决这个问题。
请告诉我如何以安全的方式获取今天和到期日之间的所有事件。
SELECT * FROM events WHERE CURRENT_DATE BETWEEN creation_date AND ending_date
SELECT * FROM events WHERE (ending_date - NOW() ) <0 ;