方法1:sql
select top 頁尺寸 * from 表名 where id not in (select top 頁尺寸*(頁數-1) id from 表名 order by id) order by id
方法2:code
select top 頁尺寸 * from 表名 where id>( select isnull(max(id),0)) from ( select top 頁大小*(頁數-1) id from 表名 order by id) ) order by id
方法3:class
select top 頁尺寸 * from ( select row_number() over(order by id) as rownumber,* from 表名) where rownumber>頁尺寸*(頁數-1)