Inner Join And Outer Join

by | Apr 18, 2018 | ABAP Beginner

Preface – This post is part of the ABAP Beginner series.

Inner Join and Outer Join

Inner Join and Outer Join are the two different ways to join two tables. Both of them produce different result. In this article we will learn both of them.

Suppose you have two tables with two fields and following data as shown below:

table 1
Table 1

table 2
Table 2

Now if you want data that is common in both the table then you will apply Inner Join and get following results:

Inner Join And Outer Join Example1
And if you want all data irrespective of its presence in any table, you will apply outer join and get results as shown below:

Inner Join And Outer Join Example2

Now let see definition of both of the Joins.

Definition

Inner Join

A join that is utilized by Database views which gives the cross-product of the records present in both table.

[For basics of Joins click here]

Outer Join

A join that shows the cross-product of all the records present in different tables. It is utilized by Help Views, Projection Views and Maintenance Views. [For basics of Views click here]

It is of two types:

  1. Left Outer Join: It is just like outer join, it includes all the results of Outer Join with all data from the left table.
  2. Right Outer Join: It is also just like outer join, it includes all the results of Outer Join with all data from the right table.

 

Author

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.