Page 1 of 1

Select last rows from MySQL table.

Posted: Sat Feb 25, 2012 7:08 am
by lovelf
How to select the last rows having a primary key that is auto incremented, how to select only the last x amount of records that were inserted into the table for example.

Re: Select last rows from MySQL table.

Posted: Sat Feb 25, 2012 7:32 am
by Celauran

Code: Select all

SELECT foo FROM table_name ORDER BY id DESC LIMIT 10