0

If Left Outer Join and Left join do the same exact thing. Are there any advantages to use one over the other? What scenarios might you choose to say Left Join over Left Outer Join or vice versa?

CSharper
  • 5,420
  • 6
  • 28
  • 54
  • Um....You wouldn't? If you are positive, RI is enforced, etc, there is no reason. – Andrew Apr 30 '14 at 20:35
  • 5
    They are semantically same. Second just short form of first. – Hamlet Hakobyan Apr 30 '14 at 20:35
  • `Outer` is merely optional, as is `Inner` from `Inner Join`. It's purely preference by whomever is writing it. – Siyual Apr 30 '14 at 20:37
  • Unless some DBMS allows only one the two syntaxes, it is purely preference. – ypercubeᵀᴹ Apr 30 '14 at 20:40
  • 2
    I do it for readability. It helps clearly distinguish INNER and OUTER joins when I'm glancing at it – Marshall Tigerus Apr 30 '14 at 20:42
  • duplicate of http://stackoverflow.com/questions/406294/left-join-and-left-outer-join-in-sql-server?rq=1 – DeanOC Apr 30 '14 at 20:44
  • Lots of SQL terms are optional... ([`outer`], [`inner`], [`as`], `Insert [into]`, `delete [From] tablename`, etc... and so it depends on whether you like shorter terse code that requires less effort to read, or longer, redundant code that is does not require as much familiarity to read correctly. – Charles Bretana Apr 30 '14 at 20:48

2 Answers2

3

The keywords inner and outer are optional (like many others). The join type is implied:

  • unqualified = inner
  • left = outer
  • right = outer
  • full or cross = outer

I personally never use them as they are code clutter.

Charles Bretana
  • 143,358
  • 22
  • 150
  • 216
Bohemian
  • 412,405
  • 93
  • 575
  • 722
1

They are exactly the same. The outer join is optional.

HOWEVER, If you do not specify an Outer join type: Left, Right, or Full, then it will be an INNER join.

In the context of Left/Right they are equivalent to an OUTER join and therefore OUTER will be defaulted, and can, semantically be added.

Left Join == Left outer join

Like some people have said, it's very nice for the readability.

Joe Swindell
  • 684
  • 1
  • 7
  • 18