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
FROMCustomers
FULL OUTER JOIN Orders
ONOrders.CustomerID = Customers.CustomerID;
FULL OUTER JOIN returns all records from both tables, even if there are no matches
Leave a Reply