MySQL Forums
Forum List  »  Newbie

Re: Selecting last ROW of a table:
Posted by: Rick James
Date: April 22, 2015 11:17PM

> when it's full it starta a new table

Why? A table can be arbitrarily big.

Assuming the table `tbl` has a field called `datetime`, this will provide the contents of the latest row:

SELECT * FROM tbl ORDER BY datetime DESC LIMIT 1;

It would be helpful to have
INDEX(datetime)

Options: ReplyQuote


Subject
Written By
Posted
Re: Selecting last ROW of a table:
April 22, 2015 11:17PM


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.