只读取本页的分页存储过程CREATE procedure main_table_pwqzc
只读取本页的分页存储过程(
@pagesize int,
只读取本页的分页存储过程
@pageindex int,
只读取本页的分页存储过程
@docount bit,
只读取本页的分页存储过程
@this_id int)
只读取本页的分页存储过程
as
只读取本页的分页存储过程
if(@docount=1)
只读取本页的分页存储过程
begin
只读取本页的分页存储过程
select count(id) from luntan where this_id=@this_id
只读取本页的分页存储过程
end
只读取本页的分页存储过程
else
只读取本页的分页存储过程
begin
只读取本页的分页存储过程
declare @PageLowerBound int
只读取本页的分页存储过程
declare @PageUpperBound int
只读取本页的分页存储过程
set @PageLowerBound=(@pageindex-1)*@pagesize
只读取本页的分页存储过程
set @PageUpperBound=@PageLowerBound+@pagesize
只读取本页的分页存储过程
create table #pageindex(id int identity(1,1not null,nid int)
只读取本页的分页存储过程
set rowcount @PageUpperBound
只读取本页的分页存储过程
insert into #pageindex(nid)
只读取本页的分页存储过程
select id from luntan where this_id=@this_id order by reply_time desc
只读取本页的分页存储过程
select O.*
只读取本页的分页存储过程
from luntan O,#pageindex p
只读取本页的分页存储过程
where O.id=p.nid and p.id>@PageLowerBound and p.id<=@PageUpperBound order by p.id
只读取本页的分页存储过程
end
只读取本页的分页存储过程
GO

 

相关文章:

  • 2021-09-10
  • 2021-06-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-04
相关资源
相似解决方案