在我的数据库中,table_a 的每一行都有一个 date_created,如“2011-04-17”
现在其中一些日期已经过去了,但我的问题是如何检索尚未过去的最新日期?
最佳答案
试试这个
SELECT * FROM table_a WHERE CURDATE() <= date_created
Returns the current date as a value in 'YYYY-MM-DD' or YYYYMMDD format, depending on whether the function is used in a string or numeric context.
关于MYSQL从表中获取尚未过去的最后日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20081722/