Limiting Your Results
For limiting the result from select query you can use use the LIMIT clause. Which will return only a certain number of records in your SELECT query result. There are two requirements when using the LIMIT clause: offset and number of rows. The offset is the starting position, and the number of records you want from the start offset position.
In general the offset starts from 0.
Few examples to demonstrate the LIMIT
1. SELECT * FROM users LIMIT 0, 10;
2. SELECT * FROM users LIMIT 10, 10;
3. SELECT * FROM users ORDER BY name LIMIT 20, 10;
The sql will not fire any error if your limit is beyond the number of query exist
for example if the users table contain 20 records
then ” SELECT * FROM users LIMIT 40, 10;”
will not give you error message .It will return empty set .
