English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
FULL OUTER JOIN returns all rows when there is a match in either the left or right table.
The following SQL statement selects all customers and all orders:
SELECT Customers.CustomerName, Orders.OrderID FROM Customers FULL OUTER JOIN Orders ON Customers.CustomerID=Orders.CustomerID ORDER BY Customers.CustomerName;
Note:The FULL OUTER JOIN keyword returns all rows from the left table (Customers), and all rows from the right table (Orders). If some rows in 'Customers' do not have a match in 'Orders', or if some rows in 'Orders' do not have a match in 'Customers', these rows will also be listed.