分页
select * from (select ROW_NUMBER() over(order by ID) num , * from TB) A num between 21 and 30
ROW_NUMBER() OVER (order by ID) 是先把ID列排序,再为排序以后的每条ID记录返回一个序号。