MYSQL Datetime获得一个月前的日期提取 [英] MYSQL Datetime getting a date extract one month back
本文介绍了MYSQL Datetime获得一个月前的日期提取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当前日期为2011/12/05
..,如何获取一个月前的日期提取? 2011/11/05
?在MYsql中?
having a current date as 2011/12/05
.. , how to get a date extract one month back ? 2011/11/05
? in MYsql?
推荐答案
您可以通过在WHERE中添加条件来做到这一点:
You can do this by adding condition to the WHERE:
created_at <= DATE_SUB(CURDATE(), INTERVAL 1 month)
这篇关于MYSQL Datetime获得一个月前的日期提取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文