Javatpoint Logo

91-9990449935

 0120-4256464

Right Outer Join

The right outer join returns all rows from the right hand table specified in the ON condition and only those rows from the other table where the inner join condition is true.

The right outer join is absolute opposite of left outer join.

Image representation:

postgresql-right join

Syntax:

See this example:

Let's take a table "EMPLOYEES" having the following data.

Table1: EMPLOYEES

Psotgresql right join1

Create another table "DEPARTMENT" having the following data.

Table2: DEPARTMENT

postgresql-right join

Execute the following query:

Output:

postgresql-right join