问题描述
我正在创建一个查询,该查询将显示从8个表派生的记录信息.最初编写查询的开发人员使用了等于"和等于"的组合来创建联接.
I'm creating a query that will display information for a record which is derived from 8 tables. The developer who originally wrote the query used a combination of 'where this equals this' AND 'this equals this' to create the joins.
此后,我将查询更改为使用INNER JOINS.我想知道我的方法是否比结合使用WHERE运算符更好.
I have since changed the query to use INNER JOINS. I wondered if my approach was better than utilising a combination of WHERE operators.
从良好实践的角度来看,将INNER JOINS组合在一起是一个不错的选择,或者我应该采用其他技术.
On a measure of good practice, is a combination of INNER JOINS a good option or should I be employing a different technique.
推荐答案
从性能的角度来看,不会有任何区别...至少不在著名的RDBMS(如Sql-server/Oracle)上...这些数据库引擎,能够识别两种模式的含义相同,并且对两种模式使用相同的执行计划...
From performance point of view, there will not be any difference... atleast not on prominent RDBMS like Sql-server / Oracle... These Database Engine, are capable of identifying both the patterns means the same and use the same execution plan for both...
在我的拙见中,这两者都是同等的好习惯,但是您应该保持一致性和正确的对齐方式……在某个地方,我听说oracle开发人员通常使用where子句,而Sql-Server通常使用内部联接...不是很多可以肯定的是...到目前为止,大多数编码人员都能够理解这两种查询...
In my humble opinion both are equally good practice, but you should maintain consistency and proper alignment... Somewhere I heard that where clause are generally used by oracle developers, and inner join by Sql-Server... Not very much sure about that... By now most of the coders are capable of understanding both types of queries...
这篇关于SQL INNER JOIN问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!