本文介绍了显式与隐式 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;
对比
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:请注意,IMPLICIT OUTER JOIN
语法自 SQL Server 2005 起已弃用.(问题中使用的 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)
这篇关于显式与隐式 SQL 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!