Difference between Outer Join and Left Outer Join

  • Dear Brother's

    any brother know that what is difference between Outer Join and Left Outer Join..

    I am waiting for good response.

    Best regards

    Waqar Hussain Laghari

  • Go to Books Online > Type "outer joins"

    You know we are here to help you when you are stuck with an issue that you are not able to resolve, information such as this can be easily found by looking into Books Online or little bit of Googling.

    --Ramesh


  • waqarlaghari (4/3/2009)


    any brother know that what is difference between Outer Join and Left Outer Join..

    What is it that you didn't understand? Could you be more specific please?

    I am waiting for good response.

    😉

  • waqarlaghari (4/3/2009)


    any brother know that what is difference between Outer Join and Left Outer Join..

    "Outer Join" is a general term for all outer-type joins. "Left Outer Join" is a specific type of outer join and is the actual valid syntax for it also.

    Consider the syntax of the FROM clause for Outer Joins:

    FROM {TableSource1}

    { LEFT | RIGHT | FULL } [OUTER] JOIN {TableSource2} ON {condition}

    Note that for an outer join, LEFT, RIGHT or FULL must be specified, the OUTER is optional.

    An join returns every combination of rows from TableSource1 and TableSource2 that together meet the ON condition. An outer join will also add to that the unmatched rows from TableSource1 (for a LEFT join) or from TableSource2 (for a RIGHT join) or from both (for a FULL join).

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Thanks brother for your reply..

    I am stuck in condition. Because i am working on project which developed by another person. In quries it uses both words "Left Outer Join" and "Outer Join". So i was confused.

    Best regads

    Waqar Hussain Laghari

  • waqarlaghari (4/6/2009)


    In quries it uses both words "Left Outer Join" and "Outer Join". So i was confused.

    In SQL Server it's not possible to have just OUTER JOIN specified. Doing so gets a syntax error. If OUTER is specified, LEFT, RIGHT or FULL must also be specified to say what kind of outer join it is. OUTER alone is ambiguous.

    SELECT * FROM

    sys.objects o OUTER JOIN sys.columns c on o.object_id = c.object_id

    Msg 156, Level 15, State 1, Line 2

    Incorrect syntax near the keyword 'JOIN'.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • If I remember correctly from my Informix days (which can be a little suspect since it has been a while and I am getting older), OUTER JOIN defaulted to LEFT OUTER JOIN. Barring any other clues, I would think your best guess as to the other developers intentions is to use Left Outer Join any time they used Outer Join.

    Steve

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply