Mysql method to query the data from items 5 to 10: execute the [select top 10 * from TB1 where Id not in (select top 5 Id from TB1)] statement to query.
Query the fifth to tenth data in the database, there are two situations:
(Recommended tutorial: mysql Video tutorial)
1. The IDs are connected. Of course, this situation is easier to check. Just SELECT directly. Just select the ID greater than 5 and less than 10.
This situation is relatively rare.
2. IDs are not connected. If you want to get the fifth to tenth data, you have to start with SQL query SELECT
select top 10 * from TB1 where Id not in (select top 5 Id from TB1 )
Among them, 10 means: the number of queries, and 5 means Which item should I start checking from?
Related recommendations: mysql tutorial
The above is the detailed content of How to query data from items 5 to 10 in mysql. For more information, please follow other related articles on the PHP Chinese website!