If you want to only return records that have matching rows in each table you join, use an INNER JOIN. The syntax of INNER JOIN and examples will be outlined in this section.
Using INNER JOIN
Learning INNER JOIN syntax
To inner join two tables, use the following syntax:
SELECT column(s)
FROM table1
INNER JOIN table2
ON table1.column = table2.column
WHERE conditions
ORDER BY column(s);
The preceding syntax shows you how to join two tables together with an INNER JOIN. You join a column in table1 that matches a column in table2. The WHERE and ORDER BY clauses are optional. They are there to show you that the INNER JOIN syntax goes between the FROM and WHERE clauses.
The following example will help you to understand how to use...