‎2007 Jun 21 4:42 PM
what is the difference between left outer join and right outer join?
‎2007 Jun 21 4:53 PM
AFAIK it works like this...
You got TABLE1 and TABLE2
Using LEFT OUTER JOIN gathers all records from TABLE1 that are not present on TABLE2...And RIGHT OUTER JOIN does the same in reversal order...It gather all records from TABLE2 that are not present on TABLE1....
To me it's just a matter of taste....Because it depends on the order of your tables in the query -;)
Greetings,
Blag.
‎2007 Jun 21 4:53 PM
Don't think that there is such a thing as a RIght Outer Join in Open SQL within ABAP.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb39c4358411d1829f0000e829fbfe/frameset.htm
Regards,
RIch Heilman
‎2007 Jun 21 5:01 PM
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