日期:2014-05-17 浏览次数:20431 次
--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