Questions tagged «cross-apply»

13
什么时候应该在内部联接上使用交叉应用?
使用CROSS APPLY的主要目的是什么? 我已经读过(模糊地通过Internet上的帖子),cross apply如果您要进行分区,则在选择大型数据集时可能会更有效率。(想起分页) 我也知道,CROSS APPLY不需要UDF作为右表。 在大多数INNER JOIN查询(一对多关系)中,我可以将它们重写为use CROSS APPLY,但它们始终会为我提供等效的执行计划。 谁能给我一个很好的例子,说明在CROSS APPLY哪些情况下INNER JOIN行之有效的情况下也有所作为? 编辑: 这是一个简单的示例,其中执行计划完全相同。(向我展示它们的不同之处以及cross apply更快/更高效的地方) create table Company ( companyId int identity(1,1) , companyName varchar(100) , zipcode varchar(10) , constraint PK_Company primary key (companyId) ) GO create table Person ( personId int identity(1,1) , personName varchar(100) , companyId int …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.