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

推荐订阅源

I
Intezer
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
T
Tenable Blog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
P
Privacy International News Feed
IT之家
IT之家
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
博客园_首页
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
I
InfoQ
D
DataBreaches.Net
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Security Latest
Security Latest
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic

博客园 - 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+的高级特性。