Well - what is considered the last of the list? Is it a number? are they names?
Either way you have a field you are ordering by ...
SELECT * FROM table ORDER BY lastname DESC LIMIT 10;
that'll do the trick. FYI you can sort numbers, dates, and chars - this is from
the hip and you might be able
> How do I get the last 10 rows in a table?
select blah from foo order by something desc limit 10
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] ("Randy Johnson") wrote:
> How do I get the last 10 rows in a table?
{select clause} order by {fieldname} desc limit 10
--
CC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
How do I get the last 10 rows in a table?
thanks
randy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
4 matches
Mail list logo