954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

displying last 10 recods from table

hi all,
how to display last 10 record form a table.please help me.

rohitrohitrohit
Junior Poster
128 posts since Oct 2007
Reputation Points: 15
Solved Threads: 5
 

Do you have a timestamp column ? Then sort descending and limit 10 on that column.

pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

either go with a timestamp or id column, assuming its an integer or bigint

select * from table order by idcolumn desc limit 10

select * from table order by timestampcolumn desc limit 10
dickersonka
Veteran Poster
1,175 posts since Aug 2008
Reputation Points: 130
Solved Threads: 143
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You