用 as with ,和 ROW_NUMBER() 做分页查询

with mytable as (select * ,Row_Number() over (order by UserId asc) as Row from T_User )      //WITH AS短语,也叫做子查询部分,Row为新列(排序行号)
 
select * from mytable where Row between 100 and 1000

本文来自博客园,作者:mushishi,转载请注明原文链接:https://www.cnblogs.com/mushishi/archive/2013/06/03/3114650.html

原文地址:https://www.cnblogs.com/mushishi/p/3114650.html