Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

join

Former Member
0 Likes
442

what is the difference between left outer join and right outer join?

3 REPLIES 3
Read only

Former Member
0 Likes
419

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.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
419

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

Read only

Former Member
0 Likes
419

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