二种sql分页查询语句分享_MsSql

admin 2014年4月27日10:07:22MSSQLSERVER评论1,854 次浏览阅读模式


根据题意理解:


本质就是写分页查询:


每页条数:10条;


当前页码:4页;


复制代码 代码如下:

//第一种:
select * from
 (select ROW_NUMBER() over(order by Id asc) as num,* from UserInfo)as u
 where u.num
 between
 10*(4-1)+1
 and
 10*4
//第二种:
select top 10 * from UserInfo
where Id not in
(select top (10*3) id from UserInfo order by Id)
order by Id


相关文章
weinxin
我的微信
微信扫一扫
admin
  • 本文由 发表于 2014年4月27日10:07:22
  • 转载请务必保留本文链接:https://anyun.org/a/jishuguanzhu/database/mssqlserver/2014/0427/106.html

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: