Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MySQL:如何从ID中选择下一行_Mysql_Sql - Fatal编程技术网

MySQL:如何从ID中选择下一行

MySQL:如何从ID中选择下一行,mysql,sql,Mysql,Sql,假设我有这张桌子: ID CONTENT 1 test 1 2 test 2 3 test 3 4 test 4 5 test 5 6 test 6 7 test 7 8 test 8 9 test 9 10 test 10 如何从ID5开始选择接下来的5行 所以我应该从表order by ID limit 5,5中获取ID为6,7,8,9,10的行。您是否至少到达了

假设我有这张桌子:

ID      CONTENT
1       test 1
2       test 2
3       test 3
4       test 4
5       test 5
6       test 6
7       test 7
8       test 8
9       test 9
10      test 10
如何从
ID5
开始选择接下来的5行


所以我应该从表order by ID limit 5,5中获取ID为6,7,8,9,10的行。您是否至少到达了ID为5的
order by
?我不理解否决票。您所有的答案都是错误的,除了@lvaroG.Vicario
SELECT*from table,其中ID>5 LIMIT 5
您所说的基本上是创建分页。您需要限制,然后使用NEXT。。。。因此,它将按结果集进行过滤
select * 
from your_table 
where id > 5 
order by id asc limit 5