SQL Full Joins


Prev Tutorial Next Tutorial

SQL Full Joins

Full Join keyword returns all rows from the left table (table1) and from the right table (table2). It is the combination of Left join and Right Join.

full join

Syntax

	
SELECT column_name
FROM table1
FULL OUTER JOIN table2
ON table1.column_name=table2.column_name;

Employee table

Emp_idName
101Amit Sukla
102Rahul jain
103Sultan Alam

Payment table

Payment_idSalary
10120000
10245000

Example

	
SELECT Employee.Emp_id,Employee.name, Payment.salary
FROM Employee
FULL OUTER JOIN Orders
ON Employee.Emp_id=Payment.Payment_id

After execute above query, result show like below;

Emp_idNameSalary
101Amit Sukla20000
102Rahul jain45000
103Sultan AlamNull
101Amit Sukla20000
102Rahul jain45000

Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements