faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 3 people (100%) answered Yes
Recently 3 of 3 people (100%) answered Yes

Entry

How can I output the latest 25 rows in a table?

Mar 15th, 2004 10:40
Matt Chatterley, Thomas Cherian,


If your table has an incremental primary key (eg INT AUTO_INCREMENT),
then the newer the row, the higher the PK:
SELECT * FROM Table1 ORDER BY RowID DESC LIMIT 25;