使用WITH AS 的ROW_NUMBER分页

9/1/2015来源:SQL技巧人气:1749

使用WITH AS 的ROW_NUMBER分页

WITH tempTable AS( --复杂查询语句)

SELECT * FROM (select ROW_NUMBER() Over( order by xxx) as rowNum, * from tempTable) as tempTable1where rowNum> 0 and rowNum<30