SQLite's LIMIT clause is used to limit the amount of data returned by a SELECT statement.
Grammar
The basic syntax of a SELECT statement with a LIMIT clause is as follows:
FROM table_name
LIMIT [no of rows]
The following is the syntax of the LIMIT clause when used with the OFFSET clause:
FROM table_name
LIMIT [no of rows] OFFSET [row num]
The SQLite engine will return all rows starting from the next row up to the given OFFSET, as shown in the last example below Show.
Example
Assuming the COMPANY table has the following records:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------- ----------- ---------- ----------
1 " Paul " 32 " California 20000.0
2 " Allen 25 Texas 15000.0
3 Teddy 23 NORWAY 20000.0 ## 4 Mark 25 Rich-Mond 65000.0
5 David 27 TEXAS 85000.0
6 KIM 22 South-Hall 45000.0
7 Jamest On 10000.0
Here is an example that limits the number of rows you want to extract from the table:
3 Teddy 23 NORWAY 20000.0 ## 4 4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
6 Kim 22 South-Hall 45000.0
However, in some cases it may be necessary to start from a specific offset Extract records. The following is an example, starting from the third position to extract 3 records:
This will produce the following results:
3 ‐ David 27 Texas 85000.0












![Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]](https://img.php.cn/upload/course/000/000/035/5d27fb58823dc974.jpg)









