查1000行到2000行之间的纪录怎么查???

asxulong 2004-12-22 11:08:37
查1000行到2000行之间的纪录怎么查???
...全文
511 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
likesunny 2004-12-22
  • 打赏
  • 举报
回复
先查rs1:top 1000 然后再查rs2:top 2000并且不在 not in rs1中就可以了!
wuzhouhome 2004-12-22
  • 打赏
  • 举报
回复
你没有给出标识怎么查??
MY128 2004-12-22
  • 打赏
  • 举报
回复
关注中,帮你顶一下
NinGoo 2004-12-22
  • 打赏
  • 举报
回复
select top 1000 id from table
where id not in (select top 1000 id from table order by id)
order by id


这个需要ID唯一才能得到正确的结果
zhuxiaojun2002 2004-12-22
  • 打赏
  • 举报
回复
select top 1000 id from table
where id not in (select top 1000 id from table order by id)
order by id

http://community.csdn.net/Expert/topic/3513/3513760.xml?temp=.9601862
NinGoo 2004-12-22
  • 打赏
  • 举报
回复
上面有点小小的语法错误,增加列时用add不是add column,呵呵

alter table table1 add NewID int identity(1,1)

select col1,col2..from table1 where NewID>=1000 and NewID<=2000

alter table table1 drop column NewID
asxulong 2004-12-22
  • 打赏
  • 举报
回复
没有一句就能查出来的哦!
就像select top 100 * from table;
NinGoo 2004-12-22
  • 打赏
  • 举报
回复
alter table table1 add column NewID int identity(1,1)

select col1,col2..from table1 where NewID>=1000 and NewID<=2000

alter table table1 drop column NewID
asxulong 2004-12-22
  • 打赏
  • 举报
回复
有没有人会啊!帮帮忙了

27,579

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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