惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
Cloudbric
Cloudbric
Google Online Security Blog
Google Online Security Blog
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tenable Blog
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
V
Visual Studio Blog
P
Proofpoint News Feed
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
L
LangChain Blog
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东

博客园 - Leonny

IIS站点/虚拟目录中访问共享目录(UNC)以及建立后的应用程序的信任级别问题 谁说用Azure就一定要Vista/Win7?Window2003/xp下安装 Windows Azure Tools for Microsoft Visual Studio IE的window.showModalDialog出现内存不足的问题 - Leonny - 博客园 关于清理JBoss服务器端jsp文件缓存的问题 提取assemblyinfo.cs文件里的guid值 经常坐电脑旁的人必喝的健康饮品 Firefox图片模糊的问题 [原创]OWC生成Excel的效能优化 [译]NUnitForms官方说明文档 C#取得MS Word的总页数 VS2008中文版安装ASP.NET MVC Beta WinForm下ComboBox添加项与设定预选项 成功申请了GAE Vista删你文件没商量 3大数据库的变量参数符号 新立得软件包管理器出错 Repeater中點擊按鈕事件時要注意頁面PostBack的問題 關於Web Service 中使用NHibernate時無法序列化IList的問題 如何取得輸入字符串的寬度
MS SQL Server2005如何得到记录的行号
Leonny · 2008-12-08 · via 博客园 - Leonny

在Oracle中有一个rownum可以得到每条记录的行号,
但在以前版本的MS SQL Server中一直没有类似的关键字或内部函数,

因此以往使用MS SQL Server时记录的分页一直是个很让人头痛的问题.
但在2005版, 它提供了一个内建函数ROW_NUMBER().

通过它现结合Over()函数就可以轻松对记录进行分页了.

代码:

select * from (select
ROW_NUMBER() 
OVER (order by orderColumn)as RowNumber, 
* from tableName) as tmpTable
where RowNumber between 50 and 60

PS. 这样的分页效果明眼人一看就知道效率如何了. 小数据量还好, 大数据量的话...真是和Oracle没法比啊. 呵呵
不知道大家还有没有更好的大数据量分页方法, 要简单的哦, 不要SQL拼来拼去的. ^_^