MySQL: Top $num results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"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. "

http://dev.mysql.com/doc/mysql/en/limit-optimization.html

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?

John

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux