It is common in web application there is the return of a very large volume of records when performing a query tables that store large amounts of data need a parameter must stop for a simple query does not lock any application.

For queries with a very large volume of returns are optimized LIMIT command is used, it is responsible for determining exactly which records will appear through an initial and final number.

To use the LIMIT command just add it in the query syntax as shown below:

SELECT [Fields] FROM [Table] LIMIT [X,X]

The parameters to be specified for the command LIMIT points indicate that the records should be displayed and how far they will appear. We go to a practical example.

SELECT Cod_prod, Name

FROM Product


Using the above command will be shown only eight records in the query starting with the first record (index 0). If you want the query to start at another location just indicate it in the first parameter.

The LIMIT command is used in various situations, among the key can highlight pagers. They are widely used by web applications and help a lot in order to optimize the speed of them.


Want to know more about MySQL and how it can offer numerous advantages for projects in PHP? Then visit our page on PHP and MySQL and discover several advantages over these two important technologies available in the market.

By ,

September 6, 2013


You might also like…

5 reasons you can’t miss a Black Friday Scriptcase!

This November we bring you the biggest and most important discounts of the year! And do you know wh...

Taking a look at Scriptcase version 9.7

After the big Scriptcase 9.7 presentation event, we have a new version of Scriptcase for download, ...

October Newsletter

Follow the latest news for the month of October! Webinars, blog posts, videos, and more. WEB...

You might also like…

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at Learn more about our Privacy Police.