Retrieving only a fixed number of rows in MySQL

后端 未结 6 1442
时光取名叫无心
时光取名叫无心 2020-12-03 07:55

I am testing my database design under load and I need to retrieve only a fixed number of rows (5000)

I can specify a LIMIT to achieve this, however it seems that th

6条回答
  •  余生分开走
    2020-12-03 08:16

     SELECT * FROM `your_table` LIMIT 0, 5000 
    

    This will display the first 5000 results from the database.

     SELECT * FROM `your_table` LIMIT 1001, 5000 
    

    This will show records from 1001 to 6000 (counting from 0).

提交回复
热议问题