declare @PageSize int
declare @PageIndex int
select @PageSize=10;
select @PageIndex=3;
select * from (select *,Row_number() over(order by id asc) as IDRank from UserT ) as IDWithRowNumber
where IDRank>@PageSize*@PageIndex and IDRank<=@PageSize*(@PageIndex+1)
select * from (
select (
row_number() over(order by bpi_addtime desc)) as rowNum,
bpi_ProductID,
[dbo].[GetProductTypeName](bgc_id) as TypeName ,
[dbo].[GetProductTypeName](bgc_FatherId) as FTypeName ,
bpi_title,
bpi_ProductName,
bpi_OriginalPrice,
bpi_NetPrice,
bpi_Locus,
bpi_AddTime,
bpi_Message,
bpi_VistNum,
bpi_isVisible,
bpi_isHotSale,
bpi_isPinPai,
bbms_MemShopID,
PI_stockNum,
bpi_isRecommend,
bpi_RecDate from dbo.BLN_ProductItems ) as t
where t.rowNum between 1 and 2 order by newid() asc