Oracle: Left Outer Join Or Left Join

Oracle: Left Outer Join Or Left Join

Before studying this concept of Left outer join, You all should have a clear understanding about Natural Joins. Natural Joins helps to connect table through common provided columns that have matching values.

Outer Join in Oracle helps tp present the data that is common in table along with the data present in the left table. Follow the below diagram to clearly understand the concept:

left outer join

Syntax

Select column from table1 left join Table2
on Table1.Roll_no=Table2.Roll_no;

Example

we have 2 tables Stu and Marks. The two tables are as follows:

left outer join

Marks Table

Now if we perform left join between both the table. It will output the values that are common in both the table and those values that are present in left most table.

Select * from Stu s left join Marks m
on s.Roll_no=m.Roll_no;

Output

left outer join

Notice that in table Stu we have an extra row that contains the details of Yashi. However, Marks Table does not contain data for Yashi. Left Join here have automatically outputted details of Yashi present in leftmost table that is Stu Table. Null values are added in place of values that were not present in the right table that is Marks Table.

Standard (Image)