Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the difference between left join and left outer join? [duplicate]

I have created 2 tables as

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

Now, I tried to use the queries

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;

But I get the same output. Is there any difference between them internally in their working ? or are both same!?

like image 216
Shree Naath Avatar asked Oct 17 '16 12:10

Shree Naath


People also ask

What is the difference between left join and left outer join?

There really is no difference between a LEFT JOIN and a LEFT OUTER JOIN. Both versions of the syntax will produce the exact same result in PL/SQL. Some people do recommend including outer in a LEFT JOIN clause so it's clear that you're creating an outer join, but that's entirely optional.

Does left outer join remove duplicates?

Avoiding Duplicates Again, if we perform a left outer join where date = date, each row from Table 5 will join on to every matching row from Table 4. However, in this case, the join will result in 4 rows of duplicate dates in the joined DataSet (see Table 6).

What is difference between left outer join and right outer join?

Left Outer Join: Returns all the rows from the LEFT table and matching records between both the tables. Right Outer Join: Returns all the rows from the RIGHT table and matching records between both the tables.


1 Answers

The OUTER keyword is optional across most popular SQL distributions, which means there is absolutely no difference between a LEFT JOIN and a LEFT OUTER JOIN

like image 188
Chitharanjan Das Avatar answered Oct 02 '22 10:10

Chitharanjan Das