What#39;s the difference between the two SQL join notations?(两种 SQL 连接表示法之间有什么区别?)
问题描述
SQL 1: select * from t1 join t2 on t1.f1 = t2.f2
SQL 2: select * from t1,t2 where t1.f1 = t2.f2
它们返回的结果是一样的.它们之间有什么区别吗?例如,在 DBMS 中如何运行它们,或者在查询计划中?
The results that they return are same. Are there any differences between them? For example, in how the DBMS runs them, or in the query plan?
推荐答案
这两个查询在操作上没有区别.
There is no operational difference between the two queries.
然而,显式连接符号是更好的学习和使用风格;将另一个留给(尚未更改的)遗留代码.
However, the explicit join notation is the better style to learn and use; leave the other for (as yet unchanged) legacy code.
这篇关于两种 SQL 连接表示法之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:两种 SQL 连接表示法之间有什么区别?


基础教程推荐
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01