怎么直接在数据库里查询第10条以后的数据?(up有分!)

tl_pear 2005-01-20 03:29:11
怎么直接在数据库里查询第10条以后的数据?(up有分!)
比如在一数据库表——A里通过SQL语句查询第10条记录以后的数据!
谢谢大家的帮忙!
...全文
185 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
lishengyu 2005-01-20
  • 打赏
  • 举报
回复
select * from 表 where id not in(
select top 10 id from 表)
tl_pear 2005-01-20
  • 打赏
  • 举报
回复
谢谢各位!
daijingjie2002 2005-01-20
  • 打赏
  • 举报
回复
select * from 表 where id not in(
select top 10 id from 表)
tl_pear 2005-01-20
  • 打赏
  • 举报
回复
TO:zhangzs8896(小二) ( )
还有没有其他的办法!
因为这样还是先读了整个数据表A
GHOSTSEA 2005-01-20
  • 打赏
  • 举报
回复
大家都说完了嘛~~~~~~
tl_pear 2005-01-20
  • 打赏
  • 举报
回复
谢谢!
我试一下!
progrose 2005-01-20
  • 打赏
  • 举报
回复
不好意思, 我弄错了.
progrose 2005-01-20
  • 打赏
  • 举报
回复
oracle数据库
select * from ( select rownum rowretrieve, a.* from a ) where rowretrieve > 10
tl_pear 2005-01-20
  • 打赏
  • 举报
回复
哦!
不好意思!
我没有说明,数据表A里是没有关键字的!
zhangzs8896 2005-01-20
  • 打赏
  • 举报
回复
同意楼上!
如果没有id就这样:

select id=identity(int,1,1),*
into #temp
from 表

select * from #temp where id>10
drop table #temp
xluzhong 2005-01-20
  • 打赏
  • 举报
回复
select * from a
where not exists(select top 10 * from a order by id)
order by id
wzh1215 2005-01-20
  • 打赏
  • 举报
回复
select * from A where id not in(select top 10 id from A order by id) order by id

27,579

社区成员

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

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