List:General Discussion« Previous MessageNext Message »
From:Jay Blanchard Date:January 21 2005 5:29pm
Subject:RE: Elegant way: select last record from table
View as plain text  
[snip]
I'm interesting to know what is the best way to select  last inserted
record.

This can do it  "ORDER BY id desc limit 5" .. but ..
[/snip]

That is generally best, but if you have an auto-increment field

SELECT MAX(auto-increment field), * FROM `table` 
Thread
Elegant way: select last record from tableJerry Swanson21 Jan
RE: Elegant way: select last record from tableJay Blanchard21 Jan