You are here

Left join, right join, outer join, inner join

AttachmentSize
qje6o.png32.11 KB

As per the documentation: FROM (Transact-SQL):

<join_type>::=[{INNER|{{LEFT|RIGHT|FULL}[OUTER]}}[<join_hint>]]JOIN

The keyword OUTER is marked as optional (enclosed in square brackets), and what this means in this case is that whether you specify it or not makes no difference. Note that while the other elements of the join clause is also marked as optional, leaving them out will of course make a difference.

For instance, the entire type-part of the JOIN clause is optional, in which case the default is INNER if you just specify JOIN. In other words, this is legal:

SELECT*FROM A JOIN B ON A.X = B.Y

Here's a list of equivalent syntaxes:

A LEFTJOIN B            A LEFTOUTERJOIN B
A RIGHTJOIN B           A RIGHTOUTERJOIN B
A FULLJOIN B            A FULLOUTERJOIN B
A INNERJOIN B           A JOIN B

Also take a look at the answer I left on this other SO question: SQL left join vs multiple tables on FROM line?.

 

 

Ref:

https://community.oracle.com/thread/597030

http://stackoverflow.com/questions/406294/left-join-and-left-outer-join-...

 

Blog: