我不废话,只发1个SQL:
select threadid from
(
select threadid, ROW_NUMBER() OVER (order by stickydate) as Pos from cs_threads
) as T
where T.Pos > 100000 and T.Pos < 100030
打印 | 张贴于 2006-01-16 17:47:00 | Tag:Web技术
随笔 - 81, 评论 - 1578, 引用 - 157 |
||
|
我不废话,只发1个SQL: select threadid from 打印 | 张贴于 2006-01-16 17:47:00 | Tag:Web技术 对不起,目前本随笔不允许发表新评论.
|
||
|
Powered by: Joycode.MVC引擎 0.5.2.0 Copyright © 宝玉的blog |
||
留言反馈
select Top 30 threadid from
(
select threadid, ROW_NUMBER() OVER (order by stickydate) as Pos from cs_threads
) as T
where T.Pos > 100000
select threadid from ( select threadid, ROW_NUMBER() OVER (order...
比存储过程爽多了
我一年前就在这里说过了
因为,select threadid from
(
select threadid, ROW_NUMBER() OVER (order by stickydate) as Pos from cs_threads
) as T
where T.Pos > 100000 and T.Pos < 100030
这个语句是把select threadid, ROW_NUMBER() OVER (order by stickydate) as Pos from cs_threads它全部取出来,然后在SQL的外面进行排序的,没在SQL2005上测试过,因为原先在ORACLE上这样的写法是不好的,ORACLE中这样写比较好:select threadid from
(
select threadid, ROW_NUMBER() OVER (order by stickydate) as Pos from cs_threads a where a.pos<100030
) as T
where T.Pos > 100000
终于看到SQLServer在海量性能处理上的架构变动了~:)
算是好消息嗯
问一下,是不是也实现了rank()等函数呢?
还没仔细研究,这个特性很是有用。