From: Rune Kleveland Date: October 27 2000 9:32am Subject: Negative limit List-Archive: http://lists.mysql.com/internals/65 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I have a table with two fields; id and timestamp. I want to get the 20 last records for one ID, e.g. select * from tbl where id=12 order by timestamp desc limit 20; Then mysql uses a file sort, and that slows things down far to much to be acceptable if there are many records with an id. Any hope for a negative limit, e.g. select * from tbl where id=12 use index myind limit -30; or do I have to fake a timestamp field that decreases with time? Or are there other ways to do this? -- Regards, Rune Kleveland