Webmaster's Community

Designing and Development => Programming => Topic started by: rahul on September 29, 2012, 11:32:38 AM

Title: How to get last 5 records
Post by: rahul on September 29, 2012, 11:32:38 AM
hi ,
     i have a table more than 5000 records and i just want to see last n numbers of records from my table is this possible and how to achieve this with sufficient query
Title: Re: How to get last 5 records
Post by: phpdeveloper on September 29, 2012, 12:31:26 PM
This is very easy to get last n numbers of records from data base you can try like this

Code: [Select]
SELECT columnNames 
FROM YourTableName
ORDER BY columnNAme  DESC
LIMIT 5

Hope this will help you.