这里使用了SQL2005以上版本的内置函数 row_number()方法;
over里是根据什么进么排序;
rownum为子表的别名;
where t.rownum >=11 and t.rownum <=20 以出十条记录;
select * from
(
select Id,Name,row_number() over(order by id)as rownum
from category
where
id > 30
)t
where t.rownum >=11 and t.rownum <=20
(
select Id,Name,row_number() over(order by id)as rownum
from category
where
id > 30
)t
where t.rownum >=11 and t.rownum <=20