Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between left join and left outer join

Tags:

mysql

I want to know if there is any difference in LEFT JOIN and LEFT OUTER JOIN in mySQL. And if there is no difference then why two different ways are there?

Thanks in advance...

like image 485
user434909 Avatar asked Oct 15 '10 07:10

user434909


People also ask

Why LEFT join is called left outer join?

Left Outer Join: Left Outer Join returns all the rows from the table on the left and columns of the table on the right is null padded. Left Outer Join retrieves all the rows from both the tables that satisfy the join condition along with the unmatched rows of the left table.

What is the difference between left and right outer join?

The main difference between the Left Join and Right Join lies in the inclusion of non-matched rows. Left outer join includes the unmatched rows from the table which is on the left of the join clause whereas a Right outer join includes the unmatched rows from the table which is on the right of the join clause.

What is the difference between a join and an outer?

The biggest difference between an INNER JOIN and an OUTER JOIN is that the inner join will keep only the information from both tables that's related to each other (in the resulting table). An Outer Join, on the other hand, will also keep information that is not related to the other table in the resulting table.

What does (+) mean in SQL join?

The plus sign is Oracle syntax for an outer join. There isn't a minus operator for joins. An outer join means return all rows from one table. Also return the rows from the outer joined where there's a match on the join key. If there's no matching row, return null.


1 Answers

They are the same, the only reason you would want to put the 'outer' in is for clarity I think, in order to clarify that the first table in the join does not require that it has something to join to in the second table.

This is a good article on wikipedia covering some of this.

Functionally they are the same.

like image 153
Dave Avatar answered Oct 04 '22 02:10

Dave