页索引,从0开始。
select * from (select Top (页大小*(页索引+1)) ROW_NUMBER() over (order by UserName desc) as rownum ,* from ( select UserName,RealName,PhoneNum,IDNum,Money from Customers ) as pos )as tmp where tmp.rownum>(页大小*页索引) order by rownum asc
页索引,从0开始。
select * from (select Top (页大小*(页索引+1)) ROW_NUMBER() over (order by UserName desc) as rownum ,* from ( select UserName,RealName,PhoneNum,IDNum,Money from Customers ) as pos )as tmp where tmp.rownum>(页大小*页索引) order by rownum asc