mysql paging query statement

Use the limit function

1. Take the first 5 pieces of data

    select * from table_name limit 0,5 

    or

    select * from table_name limit 5 

2. Query the data from items 11 to 15

    select * from table_name limit 10,5

3. Usage of the limit keyword:

    LIMIT [offset,] rows

    offset specifies the offset of the first row to return, and rows the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1).

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324687839&siteId=291194637