摘要:
联接运算涉及下列步骤的一个子集(取决于联接的类型):1.执行笛卡尔积cross join;2.应用on筛选器;3.添加外部行(只在外联接outer join中发生)。所以,当使用内联接inner join时哪里指定逻辑表达式on和where作用一样,因为会跳过步骤3。当使用外联接outer join时,步骤2的on筛选器对保留表中部分行的删除不是最终的,因为步骤3会把这些行再添加回来,而where筛选则是最终的。例子,先插入测试数据:USE tempdbGOif OBJECT_ID('dbo.Article') is not null drop table dbo.Articl 阅读全文