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
 

相关文章:

  • 2021-12-04
  • 2022-02-11
  • 2021-08-13
  • 2021-08-31
  • 2021-12-04
猜你喜欢
  • 2022-01-06
  • 2021-10-04
  • 2021-05-21
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案