一、用top的方法。比如每页显示5行,查看第三页。
思路:先查出已经看过的。 然后再查没看过的。再查前5行。一定要排序。
select top 5 * from Student where studentId not in
( select top (3-1)*5 studentId form Student order by studentId asc)
order by studentId asc
二。增加行号的方法。
(select *,rowid=row_number() voer(order by studentId asc)) as t from Student where t.rowid between (3-1)*5+1 and 3*5