数据库分页

if(object_id('proc_getStudentPage','P') is not null)
    drop proc proc_getStudentPage
go
    create proc proc_getStudentPage(@startindex int,@endindex int)
as
    select count(*) from RealPZGL_D
    select * from (
        select row_number() over(order by id) as rowid ,* from RealPZGL_D 
    ) temp
where temp.rowid between @startindex and @endindex
go
原文地址:https://www.cnblogs.com/lushousong/p/5249873.html