标签:set number table roc order by tput and sele int
create proc Usp_getDatabyPage
@PageSize int,
@PageIndex int,
@PageCount int output
as
begin
select * from
(
select
*,
Rn=row_number() over(order by Tid asc)
from MyTable1
)as TblMyTable1
where TblMyTable1.Rn between (@PageIndex-1)*@PageSize+1 and @PageIndex*@PageSize
declare @rdCount int
select @rdCount=count(*) from MyTable1
set @PageCount =ceiling(@rdCount/(@PageSize*1.0))
end
标签:set number table roc order by tput and sele int
原文地址:https://www.cnblogs.com/liuhonghui/p/9119652.html