How do I get the nth data in a table?
Can the limit statement return the first few data and a few rows of data in the middle,
Mysql> SELECT * FROM table LIMIT 5, 10; Retrieving record lines 6-15
In order to retrieve all the record rows from an offset to the end of the recordset, you can specify a second parameter of-1:
Mysql> SELECT * from table LIMIT 95,-1; Retrieves the record line 96-last.
If only one parameter is given, it indicates the maximum number of record rows returned:
Mysql> SELECT * from table LIMIT 5; Retrieving the first 5 rows of records
In other words, limit n is equivalent to limit 0,n
In this way, obtaining nth data requires only a SELECT * fromtable limit n-1,1; You can get to nth data!
Derivative, know the data primary key ID, how to know that it is valid data drops how many? The answer is given later.
About MySQL get nth data