Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
On a SQL query, is
FROM (a LEFT JOIN b ON <cond>) LEFT JOIN c ON <cond>
equivalent to
FROM a LEFT JOIN b ON <cond> LEFT JOIN c ON <cond>
是的,它们是一样的。
在两者中都A被左连接到B并且生成的虚拟表被左连接到C。
A
B
C
您可能会使用paranetheses来实现这样的事情
FROM (a LEFT JOIN b ON <cond>) LEFT JOIN (c INNER JOIN d ON <cond>) ON <cond>
尽管实际上ON重要的是子句的位置而不是括号。
ON