码迷,mamicode.com
首页 > 数据库 > 详细

sql2种分页

时间:2014-08-20 21:00:33      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:ar   sp   sql   c   rom   print   as   select   

  declare @time datetime
declare @ms int
set @time= getdate()
select ID,name from (select row_number() over(order by ID) as rowNum,* from dbo.testb) as t where rowNum between 500000 and 500100
set @ms=datediff(ms,@time,getdate())
print @ms



select top 100 * from dbo.testb where Id not in
    (select top 500000 id from dbo.testb order by id)
    order by id
   

sql2种分页,布布扣,bubuko.com

sql2种分页

标签:ar   sp   sql   c   rom   print   as   select   

原文地址:http://www.cnblogs.com/zhangweixin/p/3925455.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!