如何从SQL数据库中提取地11~~20条数据?

liujian098 2006-07-17 05:35:04
我不记得了~呵呵~
...全文
116 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
loiter 2006-07-18
  • 打赏
  • 举报
回复
感觉
select top 10 * from table1 where (id not in (select top 10 id from table1))
这样的语句比
select top 20 * from table1 where...................然后move到第11条
效率低点吧
个人认为,因为分页测试过,一但数据量多,第一种要慢得多
jinjuduo 2006-07-18
  • 打赏
  • 举报
回复
select top 10 * from table1 where (id not in (select top 10 id from table1))
杨风79 2006-07-17
  • 打赏
  • 举报
回复
当然可以加上其他查询条件和排序……
杨风79 2006-07-17
  • 打赏
  • 举报
回复
select top 10 * from tablename where id not in (select top 10 id from tablename)

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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