• 关于分页加模糊查询的存储过程


    select [Uid],[Usname],[Uname],[Urole],[Upicture] from Us
    create proc Upage
    (
    @pageindex int,  ---当前页
    @pagesize int,   ---显示几条
    @pagecount int out,    ---总条数
    @name varchar(50)   ---查询名称参数
    )
    as
    ---判断有没有查询的参数
    if(@name is null)
    begin
     ---查询总记录数
     select @pagecount=COUNT(*) from Us;
     select * from(select ROW_NUMBER() over(order by Usname)as num, [Uid],[Usname],[Uname],[Urole],[Upicture] from Us ) temptable where num between ((@pageindex-1)*@pagesize+1) and (@pageindex*@pagesize)
    end
    else
    begin
     ---查询总记录数
     select @pagecount=COUNT(*) from Us where Usname like '%'+@name+'%';
     select * from(select ROW_NUMBER() over(order by Usname)as num, [Uid],[Usname],[Uname],[Urole],[Upicture] from Us  where Usname like '%'+@name+'%') temptable where num between ((@pageindex-1)*@pagesize+1) and (@pageindex*@pagesize)
     ---where num between((页码-1)*几条+1) and (页码*几条)
    end
  • 相关阅读:
    004-基于统计的翻译系统
    003-LDA
    002-01朴素贝叶斯到语言模型
    001-NLP基础
    11-word2vec
    009-TensorFlow-GPU版本安装
    008-TensorFlow的模型保存于加载
    007-RNN和LSTM
    006-卷积神经网络
    《笨方法学python》随笔
  • 原文地址:https://www.cnblogs.com/huosanpie/p/9967425.html
Copyright © 2020-2023  润新知