如何删除最后一行,如果我有一个“自动增量”字段也


How to delete last row if I have a `auto increment` field also

我想删除表格的最后一行。

查询:

delete from NEXG.user_type where `id`=last_insert_id()

id为自动递增键。

但是显示0行受影响

这背后的原因是什么?

simple:

DELETE FROM `user_type` 
ORDER BY `id` DESC
LIMIT 1