WITH DataTable AS( select *, ROW_NUMBER() OVER(order by ID) as Rowno from (select * from UserInfo) as TempTable) select * from DataTable where Rowno between 2 and 5
或着
WITH OrderedOrders AS ( SELECT *, ROW_NUMBER() OVER (ORDER BY ID) AS 'RowNumber' FROM UserInfo ) SELECT * FROM OrderedOrders WHERE RowNumber BETWEEN 50 AND 60