用 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

 

 

 

posted @ 2013-06-03 08:26  mushishi  阅读(176)  评论(0编辑  收藏  举报