(求救)提出数据库中从第10条到第20条记录的SQL语句应该怎么写?

tmluwei 2006-08-28 07:42:08
提出数据库中从第10条到第20条记录的SQL语句应该怎么写?
...全文
203 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zwlwenlong 2006-08-29
  • 打赏
  • 举报
回复
我曾经写的
select top 10 * from (select top 20 * from test order by x1)m
where m.x1 not in(select top 10 x1 from test order by x1)
student_oa 2006-08-28
  • 打赏
  • 举报
回复
我和楼上一样
shazi_pig 2006-08-28
  • 打赏
  • 举报
回复
select top 10 * from table_name where id not in(select top 10 * from table_name)
simonhehe 2006-08-28
  • 打赏
  • 举报
回复
select top 10 *
from (select top 20 * from Ytable) t
order by Ycol desc
jaway 2006-08-28
  • 打赏
  • 举报
回复
楼上笔误
select top 11 *
from (select top 20 * from #t order by id ) t
order by id desc
OracleRoob 2006-08-28
  • 打赏
  • 举报
回复

select top 100 identity(int,1,1) as ID
into #t
from syscolumns c1 ,syscolumns c2

select * from #t

--从第10条到第20条记录
select top 10 *
from (select top 20 * from #t order by id ) t
order by id desc

drop table #t

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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