MySQL Forums
Forum List  »  Newbie

Re: How do I select < 5 from all of the table?
Posted by: Russell Dyer
Date: June 27, 2005 12:15PM

Sorry, I guess I should have explained myself. I was distracted when posting the message and forgot to do so. Let me try again.

SELECT * FROM TABLE LIMIT 5, 100000000;

You can modify the LIMIT clause to include a starting point. In this case row 5. This is followed by a comma separator and the number of rows by which to limit the results set.

You implied that you wanted all rows after the starting point of 5. The LIMIT clause requires a literal value. It won't accept a wild card like * or a variable for the starting point or for the number or rows. However, you can give some absurdly high value like 100000000 that you know would be more than the number of rows contained in the table. In which case the results set will return as many rows as it finds starting after the fifth one, not to exceed 100000000. This is basically "all" rows after the first five.

Russell Dyer

Author of "MySQL in a Nutshell" (O'Reilly 2005).

Options: ReplyQuote


Subject
Written By
Posted
Re: How do I select < 5 from all of the table?
June 27, 2005 12:15PM


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.