zoukankan      html  css  js  c++  java
  • 存储过程分页

    if object_id('tempdb.dbo.##P_Sys_getUserShellNew') is not null drop table ##P_Sys_getUserShellNew   ;
        declare @iStart int 
        declare @iEnd int 
        
        SET @iStart = (@PageIndex-1)*@PageSize+1                      
        SET @iEnd = (@PageIndex-1)*@PageSize+@PageSize 
        ;with #temp1 as(
             select ROW_NUMBER() over(order by regDate desc)  as ROWINDEX   ,shopsName from dbo.V_getUserShell
        )SELECT * INTO ##P_Sys_getUserShellNew FROM #temp1
        
         select * from ##P_Sys_getUserShellNew   where ROWINDEX  BETWEEN CAST(@iStart as varchar) AND CAST(@iEnd as varchar) 
         select count(*) from ##P_Sys_getUserShellNew

    自己看的懂就行了  哈哈 做个笔记 因为经常忘记了,一直是复制粘贴

  • 相关阅读:
    CodeForces 514B
    CodeForces 514A
    UVa 818
    HDU 1003
    UVa百题总结
    UVa 11526
    UVa 12412
    UVa 211
    UVa 1587
    UVa 225 – Golygons [DFS+剪枝]
  • 原文地址:https://www.cnblogs.com/sxmny/p/3227368.html
Copyright © 2011-2022 走看看