mysql limit 执行后没有效果

fengda2870 2010-11-24 11:29:28
这两句SQL语句的执行结果是一样的不知道怎么回事

数据库:mysql5.0



select pid from cdb_posts limit 0,10;
+-----+
| pid |
+-----+
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 101 |
| 102 |
+-----+

select pid from cdb_posts limit 5,10;
+-----+
| pid |
+-----+
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
| 13 |
| 101 |
| 102 |
+-----+

不知道何故
如何解决!
...全文
375 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dawugui 2010-11-24
  • 打赏
  • 举报
回复
如果是sql server/oracle,我可以告诉你。
mysql,不懂,帮顶。
fengda2870 2010-11-24
  • 打赏
  • 举报
回复

原来是我自己错了
limit的基本用法都不会
fengda2870 2010-11-24
  • 打赏
  • 举报
回复
语句是没有错误的
可就是执行不出结果
dawugui 2010-11-24
  • 打赏
  • 举报
回复
mysql的?不懂,帮顶。
fengda2870 2010-11-24
  • 打赏
  • 举报
回复
网上找了很多的资料
都是关于优化的
加了order by 结果还是一样

mysql> select pid from cdb_posts order by tid desc limit 5,10;
+-----+
| pid |
+-----+
| 183 |
| 182 |
| 181 |
| 180 |
| 179 |
| 178 |
| 177 |
| 176 |
| 188 |
| 189 |
+-----+
10 rows in set

22,300

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧