MySQL select all rows from last month until (now() - 1 month), for comparative purposes

后端 未结 10 492
北海茫月
北海茫月 2020-12-07 18:12

I need some help writing a MySQL query to show me rows from last month, but not the whole month, only up and until the same day, hour and minute as it is now(), but 1 month

10条回答
  •  借酒劲吻你
    2020-12-07 19:03

    Simple code please check

    SELECT * FROM table_name WHERE created <= (NOW() - INTERVAL 1 MONTH)
    

提交回复
热议问题