如何使用SQL语法从MySQL表中选择最后一条记录

问题描述:

我有一张包含多个记录的表.有一个ID字段.我想选择具有最新ID(即最高ID)的记录.

I have a table with several records. There is an id field. I would like to select the record with the most recent id (i.e. the highest id).

有什么想法吗?

SELECT * 
FROM table_name
ORDER BY id DESC
LIMIT 1