MySQL Forums
Forum List  »  Newbie

Re: Selecting the Max Number/Most Recent Entry
Posted by: Roland Bouman
Date: August 06, 2005 06:54AM

If you have mysql >= 4.1 you could do:

select ...
from t
where id = (
select max(id)
from t
)

When <= 4.1, you could do:

select ...
from t
order by id desc
limit 1

Options: ReplyQuote


Subject
Written By
Posted
Re: Selecting the Max Number/Most Recent Entry
August 06, 2005 06:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.