delete the last row in a table using sql query?

前端 未结 4 1733
[愿得一人]
[愿得一人] 2021-01-02 02:43

I am trying to delete the last record in the table named \"marks\" in the database using MySql query. I was tried to do so. Also I tried on

4条回答
  •  执念已碎
    2021-01-02 03:13

    If id is auto-increment then you can use the following

    delete from marks
    order by id desc limit 1
    

提交回复
热议问题