HOW TO USE FULL OUTER JOIN IN SQL

FULL OUTER JOIN IN SQL

FULL JOIN/FULL OUTER JOIN clause returns all the records when there is a match in left(table1) or right(table2)

Syntax of FULL OUTER JOIN in SQL-

SELECT <column_name(s)>

FROM <table1>

FULL OUTER JOIN<table2>

ON <table1.column_name=table2.column_name>

WHERE<condition>;

Example of FULL OUTER JOIN in SQL-

SELECT Customers.CustomerName, Orders.OrderID

FROM Customers

FULL OUTER JOIN Orders

ON Orders.CustomerID = Customers.CustomerID;

FULL OUTER JOIN returns all records from both tables, even if there are no matches


Leave a Reply

Your email address will not be published. Required fields are marked *