Left Outer Join

Last post 09-18-2008 5:57 AM by Madhivanan. 7 replies.
Page 1 of 1 (8 items)
Active Topics My Discussions Unanswered Sort Posts: Previous Next
  • 09-16-2008 3:09 PM

    Left Outer Join

    Hi there,

    I have 2 tables with foreign key relationship. I am trying to get all the orders for all the customers.In case customer does not have any order it should still be giving result with Null in order field.
    I am using Left Outer Join but i am not getting result for the customers who dont have any orders.

    Any clue?

    Thanks!

  • 09-16-2008 10:47 PM In reply to

    Re: Left Outer Join

    Hi Danny,

     Please send me in a basic overview of the table structure so that I could work that out for you.

    Regards,

    Surya 

    Thank You & Regards,
    K.Surya Kiran.
  • 09-16-2008 10:53 PM In reply to

    Re: Left Outer Join

    Hi Danny,

    A quick reply could be, if you are using conditions in the WHERE clause try moving them to the Left Outer join . Try this out and let me know, as Conditions in WHERE Clause would result in INNER JOIN based on the conditions you have inputted in the WHERE Clause

    Thank You & Regards,
    K.Surya Kiran.
  • 09-17-2008 2:22 AM In reply to

    Re: Left Outer Join

    danny123:

    Hi there,

    I have 2 tables with foreign key relationship. I am trying to get all the orders for all the customers.In case customer does not have any order it should still be giving result with Null in order field.
    I am using Left Outer Join but i am not getting result for the customers who dont have any orders.

    Any clue?

    Thanks!

    Post the code you used

    Madhivanan

    Failing to plan is Planning to fail
  • 09-17-2008 9:01 AM In reply to

    Re: Left Outer Join

    Thanks everyone for quick responses but Where clause was causing the issue. I just needed to twick the joins between tables and it worked.

    Thanks!

  • 09-17-2008 11:44 AM In reply to

    • satya
    • Top 10 Contributor
    • Joined on 11-05-2002
    • United Kingdom
    • Posts 22,515
    • Microsoft MVP
      Moderator

    Re: Left Outer Join

    If you can post the code it helps to identify the root cause of the issue than suggesting shot in dark.

    -Satya S K J

    SQL Server MVP



    Knowledge is Power, you will gain by sharing it. SSQA.net - Invisible contributions to the users & visible success in SQL Community.
  • 09-18-2008 3:31 AM In reply to

    Re: Left Outer Join

    satya:

    If you can post the code it helps to identify the root cause of the issue than suggesting shot in dark.

     

    Issue already resolved, I guess. Smile

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Contributing Editor, Writer & Forum Moderator http://www.sql-server-performance.com
    Webmaster: http://www.insidesql.org
    View Frank Kalis's profile on LinkedIn

    XING
  • 09-18-2008 5:57 AM In reply to

    Re: Left Outer Join

    FrankKalis:

    satya:

    If you can post the code it helps to identify the root cause of the issue than suggesting shot in dark.

     

    Issue already resolved, I guess. Smile

    But still there may be chance for improvement if posted Wink

    I would like to see the problamatic and workable query

    Madhivanan

    Failing to plan is Planning to fail
Page 1 of 1 (8 items)
Active Topics   My Discussions    Unanswered Posts


© 2000 - 2007 vDerivatives Limited All Rights Reserved.