select LIMIT last?
Moderator: General Moderators
select LIMIT last?
How can I structure a LIMIT statement to return only the last result?
http://www.mysql.com/doc/en/SELECT.html
have a look at LIMIT with 2 arguments
eg:
mysql> SELECT * FROM table LIMIT 5,10; # Retrieve rows 6-15
so:
mysql> SELECT * FROM table LIMIT 5,1; will return row 6
(The offset of the initial row is 0 not 1)
have a look at LIMIT with 2 arguments
eg:
mysql> SELECT * FROM table LIMIT 5,10; # Retrieve rows 6-15
so:
mysql> SELECT * FROM table LIMIT 5,1; will return row 6
(The offset of the initial row is 0 not 1)