Skip to Content
author's profile photo Former Member
Former Member

Left outer join

Hi,

Over these years, i had not use the left outer join at all.

Can anyone tell me PRACTICALLY where does it come into picture? I know the concept behind this join. so please do not explian about joins.

thanks

Dany

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 28, 2007 at 07:16 PM

    This is about outer join of another users, publishing here.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 03:56 PM

    Consider the scenerio given below:

    Table1 is having list of all incoming email coming to SAP CRM system. THese emails are configured(based on information in subject line) to create sales order in the system.

    Table2 is having list of all the emails which are creating sales order and the corresponding sales order number.

    Now you want to check the successful and errored emails.

    For that you can use

    SELECT email salesno from table1 as a left outer join table2 as b

    on a.email = b.email.

    This will fetch all email records and also it will display NULL in salesno for all those email records which are not creating any sales order.

    Hope it helps.

    Regards,

    Amit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 04:04 PM

    I have not used Outer joins since it is more performance issue,Plase take a look at below explanation:

    INNER JOIN: Retrieves customers with orders only. For example, you want to determine the amount ordered by each customer and you only want to see those who have ordered something

    SELECT Customers., Orders.

    FROM Customers INNER JOIN Orders ON Customers.CustomerID =

    Orders.CustomerID

    -


    LEFT OUTER JOIN: Retrieves all customers with or without orders. Order data for customers without orders appears as NULL values. For example, you want to determine the amount ordered by each customer and you need to see who has not ordered anything as well. You can also see the LEFT OUTER JOIN as a mirror image of the RIGHT OUTER JOIN if you switch the side of each table.

    SELECT Customers., Orders.

    FROM Customers LEFT OUTER JOIN Orders ON Customers.CustomerID =

    Orders.CustomerID

    -


    RIGHT OUTER JOIN: Retrieves all orders with or without matching customer records. Customer data for orders without customers appears as NULL values. For example, you want to determine if there are any orders in the data with undefined CustomerID values (say, after a conversion or something like it). You can also see the RIGHT OUTER JOIN as a mirror image of the LEFT OUTER JOIN if you switch the side of each table.

    SELECT Customers., Orders.

    FROM Customers RIGHT OUTER JOIN Orders ON Customers.CustomerID =

    Orders.CustomerID

    Thanks

    Seshu

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.