Vonder Vonder - 4 months ago 10
SQL Question

How to select the last record from MySQL table using SQL syntax

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).

Any ideas?

Answer
SELECT * 
FROM table_name
ORDER BY id DESC
LIMIT 1