分页SQL

create procedure getPager
@page int,
@pageCount int
as
select top (@pageCount)  * from Base_ProductInfo
where Product_Id not in (
 select top (@pageCount*(@page-1))  Product_Id from Base_ProductInfo order by Product_Id
)

exec getPager 2,10

你可能感兴趣的:(分页SQL)