简单SQL加入理解? [英] Simple SQL Join Understanding?
本文介绍了简单SQL加入理解?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
显式与隐式SQL连接
使用多表中的join和select有什么区别吗?
SQL连接:SQL ANSI标准的未来(其中vs join)?
JOIN和在FROM子句中声明多个表有什么区别?
What is the difference between JOIN and declaring multiple tables in the FROM clause?
如:
SELECT *
FROM table1 AS t1,
table2 AS t2
WHERE t1.id = t2.id
相比:
SELECT *
FROM table1 AS t1
INNER JOIN table2 AS t2 ON t2.id = t1.id
推荐答案
第二个版本,显式 JOIN $ c $
The second version, with the explicit JOIN
and join condition is standardized SQL.
隐式连接语法与 WHERE
子句是不建议使用的语法,而是被认为是坏的) - 部分是因为很容易忘记 WHERE
子句并导致笛卡尔乘积。
The implicit join syntax with a WHERE
clause is deprecated syntax (or, rather, considered bad) - partially because it is easy to forget the WHERE
clause and cause a Cartesian product.
这篇关于简单SQL加入理解?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文