A
Anonymous
Guest
How to get a id of the second maximum value in mysql?
reply asap
Thank you
reply asap
Thank you
$row = mysql_fetch_array(mysql_query("SELECT `id` FROM `database_here` ORDER BY `id` DESC LIMIT 1, 2"));
tranquillo said:I know this post is over a month old, but anyways...
if you use MySQL 4.1:
SELECT MAX(id) FROM table WHERE id<(SELECT MAX(id) FROM table);
or something like that...