SQL2008--行号的得到

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

posted on 2015-07-13 14:24  疯狂delphi  阅读(493)  评论(0编辑  收藏  举报

导航