t-sql中分页模糊查询执行时如何把%传进去
createprocproc_page@pageint,@namechar(20)asselecttop(10)*fromuserswhereunamelike@name...
create proc proc_page
@page int,
@name char(20)
as
select top(10) * from users where uname like @name and uid not in(select top(10*(@page-1)) uid from users order by uid asc
) order by uid asc
用执行语句写
exec proc_page @page=1,@name=?
比如找姓李的 ?中怎么写啊写 李% 一直报错啊 展开
@page int,
@name char(20)
as
select top(10) * from users where uname like @name and uid not in(select top(10*(@page-1)) uid from users order by uid asc
) order by uid asc
用执行语句写
exec proc_page @page=1,@name=?
比如找姓李的 ?中怎么写啊写 李% 一直报错啊 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询