|
|||||||||||
|
Re: Select Last X rows
From: Andrew Hutchings <info(at)a-wing.co.uk>
Date: Sat Jun 30 2007 - 12:19:36 EDT
>> Hi, >> >> Try something like this: >> >> select * from (select * from table_name where ... order by last_update >> desc limit 10) as tbl order by tbl.last_update; > > > > Rich in Toronto > > I guess you could do: select * from table WHERE id > ((SELECT MAX(id) from table) - 10); Its not perfect, but it executes pretty fast for me. -- Andrew Hutchings - LinuxJedi - http://www.linuxjedi.co.uk/ Windows is the path to the darkside...Windows leads to Blue Screen. Blue Screen leads to downtime. Downtime leads to suffering...I sense much Windows in you... -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=lists@pantek.comReceived on Sat Jun 30 12:20:31 2007 This archive was generated by hypermail 2.1.8 : Sat Jun 30 2007 - 12:30:02 EDT |
||||||||||
|
|||||||||||