--2012的OFFSET分页方式 (推荐使用 - 较为方便) select number from spt_values where type=‘p‘ order by number offset 0 rows fetch next 10 rows only; go 意思是从第1条开始 取10条
--2005的ROW_NUMBER分页方式 select number from ( select number,row_number() over(order by number) as num from spt_values where type=‘p‘ ) t where num between 11 and 15 order by number asc go
--2000的TOP分页方式 select number from ( select top 5 number from ( select top 15 number from spt_values where type=‘p‘ order by number asc ) t order by number desc ) t order by number asc
时间: 2024-10-25 09:27:43