MySQL Limit Clause Statement

How to use MySQL Limit Clause In Select Statement?

Explanation

MySQL Limit Clause Statement:


The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. It takes one or two numeric arguments, which must both be non-negative integer constants.
Lets see an example query for SELECT LIMIT statement.

Example :

MySQL Limit Clause Statement
Here the first argument of th query specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. Therefore it retrieves the rows from 3 - 7 from the student table.
We can also return the values from the beginning of the result set by specifying the number of rows in a single argument as follows.
MySQL Limit Clause Statement
The above query will retrieve the first five rows of the student table.

Ask Questions

Ask Question