前两天去面试,让写一分页存储过程,嘿,当时竟然忘了怎么写……回来后写一个记之use newssystem
go
create procedure pro_news(
@pageIndex int,
@pageSize int
)
as
declare @startRow int,@endRow int
set @startRow=(@pageIndex-1)*@pageSize+1
set @endRow=@startRow+@pageSize-1
select * from (
select *,ROW_NUMBER() over (order ...