显式与隐式SQL连接

显式与隐式SQL连接

本文介绍了显式与隐式SQL连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显式和隐式内部联接是否存在效率差异?例如:

Is there any efficiency difference in an explicit vs implicit inner join?For example:

SELECT * FROM
table a INNER JOIN table b
ON a.id = b.id;

vs.

SELECT a.*, b.*
FROM table a, table b
WHERE a.id = b.id;

推荐答案

在性能方面,它们是完全相同的(至少在SQL Server中是这样).

Performance wise, they are exactly the same (at least in SQL Server).

PS:请注意,从SQL Server 2005开始不推荐使用IMPLICIT OUTER JOIN语法.(仍然支持问题中使用的IMPLICIT INNER JOIN语法)

PS: Be aware that the IMPLICIT OUTER JOIN syntax is deprecated since SQL Server 2005. (The IMPLICIT INNER JOIN syntax as used in the question is still supported)

弃用旧样式" JOIN语法:只是部分事情

这篇关于显式与隐式SQL连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 11:09