Depends what you mean by "last" - you could show the 50 with the
latest datestamps by ending your query with something like:

ORDER BY datestampcolumn DESC
LIMIT 50;

or the 50 with the highest ID numbers, same thing:

ORDER BY id DESC
LIMIT 50;

only real problem there is then they're sorted highest to lowest, but
it is still the "last" 50.

Dan


On 6/28/06, Dirk Bremer <[EMAIL PROTECTED]> wrote:
Is there a way to use a LIMIT clause to show the last X amount of rows
or a way to emulate this behavior? For example, a table has somewhere
between 1000 and 2000 rows, but you just want to see the last 50. These
last 50 might be the most recent entries, for example. Can this be done
in single query?

Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO
- USA Central Time Zone
636-755-2652 fax 636-755-2503

[EMAIL PROTECTED]
www.nisc.coop

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to