ioannes wrote:
"If you use LIMIT row_count with ORDER BY, MySQL ends the sorting as soon as it has found the first row_count lines rather than sorting the whole table. "

I need to get the top $num results from a completely sorted table (eg sorted on ID, ie the $num latest inserted rows). Which functions should I be considering?

LIMIT works that way, the write-up is just confusing. If you "ORDER BY id DESC LIMIT 10", then you'll get the 10 highest values of "id" in the result. The write-up just means that MySQL isn't going to bother sorting the rest of the table after it finds the 10 highest (or whatever your limit is). Is that what you're after?


---John Holmes...

Amazon Wishlist:

php|architect: The Magazine for PHP Professionals –

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to