MySQL Forums :: Connector/Arduino :: Read last row?


Advanced Search

Re: Read last row?
Posted by: Charles Bell ()
Date: November 13, 2013 10:42AM

There are several ways but it depends on how the table is constructed. If you have a column that is the primary key or you can assign an order to another column, you can do this:

SELECT * FROM mydb.mytable ORDER BY my_key_field DESC LIMIT 1;

This returns the last row in the *ordered* result set.

Options: ReplyQuote


Subject Views Written By Posted
Read last row? 1918 S C 11/12/2013 03:39PM
Re: Read last row? 1188 Charles Bell 11/13/2013 10:42AM


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.