943,778 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Marked Solved
  • Views: 2557
  • MySQL RSS
Nov 7th, 2008
0

displying last 10 recods from table

Expand Post »
hi all,
how to display last 10 record form a table.please help me.
Reputation Points: 15
Solved Threads: 5
Junior Poster
rohitrohitrohit is offline Offline
120 posts
since Oct 2007
Nov 7th, 2008
0

Re: displying last 10 recods from table

Do you have a timestamp column ? Then sort descending and limit 10 on that column.
Sponsor
Featured Poster
Reputation Points: 550
Solved Threads: 728
Bite my shiny metal ass!
pritaeas is offline Offline
4,167 posts
since Jul 2006
Nov 7th, 2008
0

Re: displying last 10 recods from table

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

MySQL Syntax (Toggle Plain Text)
  1. SELECT * FROM table ORDER BY idcolumn desc LIMIT 10
  2.  
  3. SELECT * FROM table ORDER BY timestampcolumn desc LIMIT 10
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Microsoft Offers Startups Free Software, but Be Wary
Next Thread in MySQL Forum Timeline: intersect in MySQL





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC