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.

You might also like…

How the Scriptcase folders work

As a Scriptcase developer, it is convenient to know everything in detail about the environment. Th...

Do they pay for your system or code?

For all those who develop system and softwares every day at work: Have you ever wondered what makes...

What is Business Intelligence anyways?

Surely you have listened about the expression, “BI” or “Business Intelligence”, the questio...

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.