Delete all rows with timestamp older than x days

后端 未结 2 613
醉酒成梦
醉酒成梦 2020-12-02 13:09

I want to delete all the rows with timestamp older than 180 days from a specific table in my database.

I\'ve tried the this:

DELETE FROM on_search WH         


        
2条回答
  •  失恋的感觉
    2020-12-02 13:45

    DELETE FROM on_search WHERE search_date < NOW() - INTERVAL N DAY
    

    Replace N with your day count

提交回复
热议问题