我任何写sql语句实现查询第10条到第20条数据!?

liujian098 2005-11-23 04:34:30
如题~谢谢!
...全文
383 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
comszsoft 2005-11-23
  • 打赏
  • 举报
回复
select top 10 * from tableName where id not in
(select top 10 * from tableName order by id )
order by id
tianhao86 2005-11-23
  • 打赏
  • 举报
回复
用我的方法刚测试通过
tianhao86 2005-11-23
  • 打赏
  • 举报
回复
zyddamon(狗尾巴草)
如果id小于20的都被删除了怎么办
liujian098 2005-11-23
  • 打赏
  • 举报
回复
我记得还有别的方法吧~可是我一时想不起来!
zyddamon 2005-11-23
  • 打赏
  • 举报
回复
也可以用in (不知道具体数目的情况下)
tianhao86 2005-11-23
  • 打赏
  • 举报
回复
sql="select top 10 * from (select top 20 * from xx ) order by id desc"
zly22169846 2005-11-23
  • 打赏
  • 举报
回复
前提你先要有一个自动增长的ID号,
select top 11 * from table where id not in (select top 9 id from table)
zyddamon 2005-11-23
  • 打赏
  • 举报
回复
select * from user_infor where id between 9 and 21
liujian098 2005-11-23
  • 打赏
  • 举报
回复
如何写?

28,406

社区成员

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

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