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

    create proc Paing_6
    (
     @pageIndex int,
     @pageSize int,
     @name varchar(50),
     @count int output
    )
    as
    begin
    declare @con varchar(100)='%'+@name+'%'
    select * from
    (
    select ROW_NUMBER() over(order by id) as NO,* from V_stu
    where
    sName like @con
    )
    as t where t.NO between @pageSize*(@pageIndex-1)+1 and @pageIndex*@pageSize  
    select @count = count(*) from
    (
    select ROW_NUMBER() over(order by id) as NO,* from V_stu
    where
    sName like @con
    )
    as t
    declare @k float
    set @count=CEILING(convert(float,@count)/convert(float,@pageIndex)) 
    end
    go
    declare @k int
    exec Paing_6 2,10,'啊',@k output
    select @k
     
  • 相关阅读:
    Brupsuite 中插件CO2的使用
    记事本默认编码改为UTF-8
    Crackme031
    Crackme030
    Crackme029
    Crackme028
    Crackme026
    Crackme025
    Crackme024
    Crackme022
  • 原文地址:https://www.cnblogs.com/yinyongle/p/10530606.html
Copyright © 2011-2022 走看看