Loading, please wait...

Right Join

How To Use Right Join In SQL

 

Introduction:
In this article, you will learn, what Right Join is and how to use Right Join in SQL.
Right Join shows all the data from the right table. It also generates the new table to show the output. If any value does not match the left table, it displays the null value. Right Join is also called Right Outer Join.

 

Here, we have two tables-

 

Employee Table

 

 

 

Query Table

 

 

 

Now, we collect same records in both the tables, according to our condition.

 

Syntax

The syntax of Right Join is as follows.

select table1.column1, table2.column2... from table1 right join table2 on table1.common_field = table2.common_field;

 

Example

Step 1: We write our query for Right Join.

 

 

 

Now, select and execute this query.

 

Step 2: The output of this query will be:

 

 

 

Summary:
Thus, we learned, right join shows all the right table’s data between one or more tables and its use.