displying last 10 recods from table

Thread Solved

Join Date: Oct 2007
Posts: 45
Reputation: rohitrohitrohit is an unknown quantity at this point 
Solved Threads: 3
rohitrohitrohit's Avatar
rohitrohitrohit rohitrohitrohit is offline Offline
Light Poster

displying last 10 recods from table

 
0
  #1
Nov 7th, 2008
hi all,
how to display last 10 record form a table.please help me.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 869
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 140
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: displying last 10 recods from table

 
0
  #2
Nov 7th, 2008
Do you have a timestamp column ? Then sort descending and limit 10 on that column.
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,162
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: displying last 10 recods from table

 
0
  #3
Nov 7th, 2008
either go with a timestamp or id column, assuming its an integer or bigint

  1. SELECT * FROM table ORDER BY idcolumn desc LIMIT 10
  2.  
  3. SELECT * FROM table ORDER BY timestampcolumn desc LIMIT 10
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the MySQL Forum
Thread Tools Search this Thread



Tag cloud for MySQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC