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

SQL Server 分页SQL

时间:2019-07-27 15:50:59      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:strategy   index   order   from   rownum   pre   style   ges   select   

1 SELECT * FROM(SELECT ROW_NUMBER() OVER(order by Id DESC)AS rownum, 
2                                   (SELECT COUNT(*) FROM Ana_Strategy  WHERE UploadTime BETWEEN @EgyStatime AND  @EgyEndtime )AS TotalCount, 
3                                   * from Ana_Strategy) as t 
4                                      WHERE t.UploadTime BETWEEN  @EgyStatime AND  @EgyEndtime
5                                           AND  t.rownum BETWEEN  @paGeSize *( @PageIndex -1)+1 and @PageIndex* @paGeSize

 

SQL Server 分页SQL

标签:strategy   index   order   from   rownum   pre   style   ges   select   

原文地址:https://www.cnblogs.com/provedl/p/11255284.html

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