MYSQL Datetime getting a date extract one month back

后端 未结 4 2006
别那么骄傲
别那么骄傲 2021-01-14 10:25

having a current date as 2011/12/05 .. , how to get a date extract one month back ? 2011/11/05 ? in MYsql?

4条回答
  •  执念已碎
    2021-01-14 10:49

    You can do this by adding condition to the WHERE:

    created_at <= DATE_SUB(CURDATE(), INTERVAL 1 month)
    

提交回复
热议问题