Limit SQL query result in MySQL

前端 未结 7 1763
無奈伤痛
無奈伤痛 2021-02-08 16:10

I would like to limit the amount of rows I fetch in MySQL. Can you show me how?

ex:

  • 1st query I would like to retrieve only the first 10,000 records
  • <
7条回答
  •  耶瑟儿~
    2021-02-08 16:56

    in MySQL :

    SELECT * FROM `your_table` LIMIT 0, 10000 
    

    This will display the first 10000 results from the database.

     SELECT * FROM `your_table` LIMIT 10000, 20000 
    

    This will show records 10001, 10002, ... ,20000

提交回复
热议问题