bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL Tutorial
SQL•SQL Tutorial

SQL FULL JOIN

Concept visual

SQL FULL JOIN

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Sql Full Join

The FULL JOIN returns all rows when there is a match in either the left or right table. If a row in the left table has no match in the right table, the result set includes the left row's data and NULL values for all columns of the right table. If a row in the right table has no match in the left table, the result set includes the right row's data and NULL values for all columns of the left table.

The FULL JOIN

and

Full Outer Join

Formula

keywords are equal - the OUTER

keyword is optional.

Note:

Full Join

can potentially return very large result-sets!

FULL JOIN Syntax

Select

column_name(s)

From

table1

Full Join

table2 ON table1.column_name = table2.column_name

Where

condition

;

Demo Database

Below is a selection from the "Customers" table:

CustomerID

CustomerName

ContactName

Address

City

PostalCode

Country

Alfreds Futterkiste

Maria Anders

Obere Str. 57

Berlin

12209

Germany

Ana Trujillo Emparedados y helados

Ana Trujillo

Avda. de la Constitución 2222 México D.F. 05021

Previous

SQL RIGHT JOIN

Next

SQL Self Join