delete the last row in a table using sql query?

前端 未结 4 1738
[愿得一人]
[愿得一人] 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 02:50

    @Abhshek's Answer is right and works for you but you can also try the following code if the id is not increment

    DELETE FROM MARKS WHERE ID=(SELECT MAX(id) FROM MARKS)
    

提交回复
热议问题