MySQL Forums
Forum List  »  Newbie

Re: how to retrieve specific number of rows
Posted by: Felix Geerinckx
Date: August 04, 2005 03:18PM

ibakebread wrote:

> Just a way to retrieve all but the five most recent entries.

'most recent' implies you have a DATETIME or TIMESTAMP column in your table. Let's assume it is t.ts

SELECT * FROM t ORDER BY ts LIMIT 5, 10000000;

where 10000000 is a suitable large integer, at least as large as the number of records in your table.

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.