full outer join in sql code example

Example 1: Full outer join example

SELECT Customers.CustomerName, Orders.OrderID

FROM Customers

FULL OUTER JOIN Orders
ON Customers.CustomerID=Orders.CustomerID

ORDER BY Customers.CustomerName;

Example 2: full join sql

#The FULL JOIN keyword return rows when there is a match in one of the tables
synatax->SELECT column_name(s)
FROM table_name1
FULL JOIN table_name2
ON table_name1.column_name=table_name2.column_name 
/////example////
SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo
FROM Persons
FULL JOIN Orders
ON Persons.P_Id=Orders.P_Id
ORDER BY Persons.LastName

Example 3: full outer join sql

SELECT C.FirstName, C.LastName, C.Country AS CustomerCountry,        S.Country AS SupplierCountry, S.CompanyName  FROM Customer C FULL JOIN Supplier S     ON C.Country = S.Country ORDER BY C.Country, S.Country

Example 4: full join

All part of the tables both matching portions
and unmatching portions from both tables.

Example 5: full outer join in sql

FULL OUTER JOIN:
is used when retrieving data from
multiple tables and will return both
table records, matching and non-matching.

Tags:

Sql Example