SELECT id,dtime FROM dbo.TestTab ORDER BY id OFFSET 1 ROWS FETCH NEXT 100 ROWS ONLY SELECT id,dtime FROM ( SELECT ROW_NUMBER()OVER(ORDER BY id ASC) AS orderid,id,dtime FROM dbo.TestTab ) TAB WHERE orderid BETWEEN 1 AND 100 ORDER BY orderid
这里要order by 主键,不会只能取到部分数据。