Loading, please wait...

Left Join

How to use Left Join in SQL

 

Introduction:
In this article, you will learn what Left Join is and how to use Left Join in SQL.
Left Join shows all the left table data from one or more tables. It generates a new table for showing the result. If our right table data does not match according to our condition, it shows the null value. Left join is also called the Outer join.

 

Here, we have two tables-

 

Employee Table

 

 

 

Query Table

 

 

 

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

 

Syntax

The syntax of Left Join is as follows:

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

 

Example

Step 1: We write our query for Left Join.

 

 

 

Now, select and execute this query.

 

Step 2: The output of this query is:

 

 

 

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