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
I would like to limit the amount of rows I fetch in MySQL. Can you show me how?
ex:
etc
TSQL
SELECT TOP 10000
...PL/SQL
...
WHERE ROWNUM < 10000
...in mysql you do as follows
Query 1 will fetch first 1000 records,
Query 2 will fetch next 1000 records
Syntax for limits clause
LIMITS OFFSET, ROWCOUNT
Where ROWCOUNT give number of row to fetch
OFFSET gives from which row to fetch more info here
MySQL and PostgreSQL support
OFFSET
that is usually used with aLIMIT
clause.in MySQL :
This will display the first 10000 results from the database.
This will show records 10001, 10002, ... ,20000
I think the following queries will give you the desired result
@ 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