您好,欢迎访问一九零五行业门户网

写出一条Sql语句:取出表A中第31到第40记录(SQLServer,以自动增

http://www.cnblogs.com/tangself/archive/2010/09/29/1838234.html 这位园友有讲过,可以看一下,简单说,对于这个题目,用row_number可以写成这样: -- 园友文章中的写法,这也是微软官方文档里的写法 with b as ( select * ,row_number() over ( order by
http://www.cnblogs.com/tangself/archive/2010/09/29/1838234.html
这位园友有讲过,可以看一下,简单说,对于这个题目,用row_number可以写成这样:
--园友文章中的写法,这也是微软官方文档里的写法
with b as (
select *,row_number() over(order by id asc) as row_num
from a with(nolock)
)
select *
from b with(nolock)
where row_num between 31 and 40
--我一般这么写
select * from (
select *,row_number() over(order by id asc) as row_num
from a with(nolock)
) b
where row_num between 31 and 40
其它类似信息

推荐信息