MYSQL Datetime getting a date extract one month back

后端 未结 4 2008
别那么骄傲
别那么骄傲 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-14 10:46

    You also can use

    SELECT * FROM tableName WHERE createdDate >= (now() - INTERVAL 1 MONTH);
    

    if you're looking for everything created in the last month.

提交回复
热议问题