[sql]select * from post where postid = (select max(postid) from post)[/sql]But i think this will only work for MySQL 4.1 and up.
Otherwise create 2 queries: 1 to get max postid, and 1 to retrieve the row.
Ohh my example is for post table, but should be the same for thread.
Also please notice that you should check with a fully loaded table, since the optimizer might decide that if there are only a few rows, it is more efficient to use a full table scan then to use the index.
|