SQL left join vs multiple tables on FROM line?

前端 未结 11 2550
予麋鹿
予麋鹿 2020-11-22 05:08

Most SQL dialects accept both the following queries:

SELECT a.foo, b.foo
FROM a, b
WHERE a.x = b.x

SELECT a.foo, b.foo
FROM a
LEFT JOIN b ON a.x = b.x
         


        
11条回答
  •  爱一瞬间的悲伤
    2020-11-22 05:43

    Well the first and second queries may yield different results because a LEFT JOIN includes all records from the first table, even if there are no corresponding records in the right table.

提交回复
热议问题