SQL Join
SQL Join
A JOIN clause is used to combine rows from two or more tables, based on
a related column between them.
10308 2 1996-09-18
10309 37 1996-09-19
10310 77 1996-09-20
INNER is the default join type for JOIN, so when you write JOIN the parser
actually writes INNER JOIN.
Example
Example
Try it Yourself »
Demo Database
In this tutorial we will use the well-known Northwind sample database.
10308 2 7 1996-09-18
10309 37 3 1996-09-19
10310 77 8 1996-09-20
Try it Yourself »
Note: The LEFT JOIN keyword returns all records from the left table
(Customers), even if there are no matches in the right table (Orders).
SQL RIGHT JOIN Keyword
The RIGHT JOIN keyword returns all records from the right table (table2),
and the matching records from the left table (table1). The result is 0
records from the left side, if there is no match.
Demo Database
In this tutorial we will use the well-known Northwind sample database.
10308 2 7 1996-09-18
10309 37 3 1996-09-19
10310 77 8 1996-09-20
Tip: FULL OUTER JOIN and FULL JOIN are the same.
Demo Database
In this tutorial we will use the well-known Northwind sample database.
10308 2 7 1996-09-18
10309 37 3 1996-09-19
10310 77 8 1996-09-20