sql读取 数据问题

sklkitty 2010-06-04 10:02:54
如题:sql读取 数据问题


查询前4条数据是 select top 4 * from table 假设结果是 1,2,3,4
现在我想查前4条数据后的5条数据 结果是 5,6,7,8,9 请问这样SQL语句怎么写呢???
请哪位大侠帮个忙。十分谢谢。
...全文
68 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
sk_sakula 2010-06-04
  • 打赏
  • 举报
回复
取前9条数据,然后反序取top 5
  • 打赏
  • 举报
回复
jf
sklkitty 2010-06-04
  • 打赏
  • 举报
回复
非常谢谢 各位的解答 问题解决了。
eagle4125 2010-06-04
  • 打赏
  • 举报
回复
路过,顶下
huangmin3956 2010-06-04
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 holyplace 的回复:]
select top 5 * from table where [id] not in (select top 4 [id] from table)
[/Quote]up
沈勇 2010-06-04
  • 打赏
  • 举报
回复
select top 5 * from table order by id desc where id not in(select top 5 * from table order by id desc)
id按照升序排列
路人乙e 2010-06-04
  • 打赏
  • 举报
回复
select top 5 * from (select top 9 * from table order by id) order by id desc
HolyPlace 2010-06-04
  • 打赏
  • 举报
回复
select top 5 * from table where [id] not in (select top 4 [id] from table)
myhope88 2010-06-04
  • 打赏
  • 举报
回复
select top 5 * from table where id not in (select top 4 id from table)
其中id须为自动增长的
我姓区不姓区 2010-06-04
  • 打赏
  • 举报
回复
select top 5 * from table where 列名 >4

110,535

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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