Library code snippets

Limit the number of rows returned

MySQL supports the LIMIT keyword, which allows you to control how many rows are returned; ideal when displaying data over many pages. You can use LIMIT in your sql query like this:

SELECT name FROM table LIMIT 10

if you want to get the rows between 10 and 20 do the following:

SELECT name FROM table LIMIT 9, 10

For a ADO solution (with an Access / MS SQL Server database), click here.

Comments

  1. 01 Jan 1999 at 00:00

    This thread is for discussions of Limit the number of rows returned.

Leave a comment

Sign in or Join us (it's free).

 altphpfaq

Related podcasts

  • EarthClassMail.com - Moving from LAMP to .NET 3.5

    Scott chats with Matt Davis, architect at EarthClassMail.com, about their move from a LAMP stack (Linux/Apache/mysql/PHP) to .NET 3.5. What's working, what's not, and what kinds of issues are they running into as their architect their solution.

Events coming up

  • Jul 19

    OSCON

    Portland, United States

    If the first years of OSCON were about opening the minds of big business to the philosophy of open source, are the years ahead about opening the minds of the open source community to the possibilities of its future? As open source becomes fully integrated into the corporate environment, OSCON helps to define, maintain, and extend the identity of what it means to be open source.

Want to stay in touch with what's going on? Follow us on twitter!