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
2nd query I would like to retrieve only records from 10,000 - 20,000
etc
解决方案
The term you're looking for is "pagination." Unfortunately, this is done differently depending on the SQL engine.
For MS SQL Server, see this Stack Overflow question.
Since you mentioned MySQL, it's actually quite simple:
SELECT [columns] FROM [a table] LIMIT 10000
SELECT [columns] FROM [a table] LIMIT 10000 OFFSET 10000
The first statement fetches results 1-10,000, and the second statement fetches results 10,001-20,000.