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

推荐订阅源

D
Docker
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
量子位
T
Tailwind CSS Blog
T
Threatpost
The GitHub Blog
The GitHub Blog
AWS News Blog
AWS News Blog
云风的 BLOG
云风的 BLOG
K
Kaspersky official blog
P
Proofpoint News Feed
博客园 - 司徒正美
L
LangChain Blog
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
S
Secure Thoughts
The Last Watchdog
The Last Watchdog
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
T
Troy Hunt's Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Proofpoint News Feed
T
Tor Project blog
T
The Blog of Author Tim Ferriss
I
Intezer
P
Privacy & Cybersecurity Law Blog
美团技术团队
N
Netflix TechBlog - Medium
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
Application and Cybersecurity Blog
Application and Cybersecurity Blog
G
Google Developers Blog
Attack and Defense Labs
Attack and Defense Labs
T
Tenable Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Last Week in AI
Last Week in AI

博客园 - shawnliu

log4net使用guidline(写的很详细) Log4net 简明手册(来自yuhen,写的非常好) 浅谈大型网站动态应用系统架构 使用cfengine来实现服务器的自动化配置 - shawnliu - 博客园 CodeDOM & Emit & MSIL 如何在.NET中实现脚本引擎 (CodeDom篇) SQL Server中奇妙的NULL 什么是Landing Page? 老是在select中丢掉了NOLOCK有啥后果???deadlock ooo scope_identity(), @@IDENTITY, IDENT_CURRENT()区别 Introduction to SQL SQL Server Indexes [A good reference] 大众点评的年会视频 很搞 十二种标题编写方法,让你流量暴涨[zz] (测试小程序)使用XmlSerializer来连接xml config文件和类 正则表达式 1个月100万封邮件营销实战及总结[zz] B2C Opinions 年薪12万的乞丐给我上了震撼的一课 Eliminate the Use of Temporary Tables For HUGE Performance Gains
sql server apply与 join等的区别
shawnliu · 2010-01-28 · via 博客园 - shawnliu

cross apply和outer apply和join很相似

都是主要在做m*n笛卡尔集,比较显著特征是没有用到Join的ON连接了

想想也比较合理,apply应用场景应该是满足join的约束,主要应该是例如返回表变量的函数,

貌似还是没区分清楚,举个例子,返回一个customer最近的三个订单或者返回所有类别最热的5个产品

这里top N操作如果用JOIN来搞就不好搞了 哈哈 不过也不是不可以搞 用row_number() partition也可以搞定

这里用APPLY就很easy 具体怎么写,不写出来,一个月后看还记不记得咋写

还有个最傻的办法是遍历所有的customer,取出每个用户最近的三个订单,然后插入到某个零时表,

这个方法对于小数量倒也也可以考虑,毕竟方法比较直接简单,而且不需要借助sql server 2005+的高级特性。