左连接和左外连接有什么区别?

时间:2016-10-17 12:40:25

标签: sql oracle join left-join outer-join

我创建了2个表

CREATE TABLE table1(customerName VARCHAR(20),custid NUMBER ,order_id NUMBER ,price NUMBER );
CREATE TABLE table2(id NUMBER ,salary NUMBER );

现在,我尝试使用查询

SELECT t1.customername,t1.custid,t2.salary FROM table1 t1 left join table2 t2 ON t1.custid = t2.id;
SELECT t1.customername,t1.custid,t2.salary FROM table1 t1 left outer join table2 t2 ON t1.custid = t2.id;

但我得到了相同的输出。他们在工作中内部有什么区别吗?或者都是一样的!?

1 个答案:

答案 0 :(得分:21)

OUTER关键字在大多数热门SQL分发版中都是可选的,这意味着LEFT JOINLEFT OUTER JOIN

之间绝对没有区别