Explanation of FULL OUTER JOIN:

The query result set will contain data from the LEFT table even when there is no corresponding data in the RIGHT table.  It will also contain data from the RIGHT table even when there is no corresponding data in the LEFT table.

The LEFT table is specified on the left side of the JOIN statement, and the RIGHT table is specified on the right side of the JOIN statement.

Table contents:

Orders

OrderID

OrderDate

CustID

10248

04-Aug-05

VINET

10249

05-Aug-05

TOMSP

10250

08-Aug-05

HANAR

10251

08-Aug-05

VICTE

10252

09-Aug-05

SUPRD

10253

10-Aug-05

HANAR

Customers

CustID

CustName

Country

GREAL

Great Lakes Food Market

USA

HANAR

Hanari Carnes

Brazil

SUPRD

Suprêmes délices

Belgium

TOMSP

Toms Spezialitäten

Germany

TORTU

Tortuga Restaurante

Mexico

VINET

Vins et alcools Chevalier

France

Tables are joined on the CUSTID column.  Shaded CustID values do not have a matching CustID in the other table.

SQL statement:

SELECT
FROM

OrderID, OrderDate, Orders.CustID, CustName, Country
Orders FULL OUTER JOIN
Customers ON Orders.CustomerID = Customers.CustomerID

Query result set:

OrderID

OrderDate

CustID

CustName

Country

10248

04-Aug-05

VINET

Vins et alcools Chevalier

France

10249

05-Aug-05

TOMSP

Toms Spezialitäten

Germany

10250

08-Aug-05

HANAR

Hanari Carnes

Brazil

10251

08-Aug-05

VICTE

 

 

10252

09-Aug-05

SUPRD

Suprêmes délices

Belgium

10253

10-Aug-05

HANAR

Hanari Carnes

Brazil

 

 

GREAL

Great Lakes Food Market

USA

 

 

TORTU

Tortuga Restaurante

Mexico

<< Return to Joining tables