When you join tables, the type of join that you create determines the rows that appear in the result set. You can create the following types of joins:
titles
and publishers
tables to create a result set that shows the publisher name for each title. In an inner join, titles for which you do not have publisher information are not included in the result set, nor are publishers with no titles.Note Columns containing NULL do not match any values when you are creating an inner join and are therefore excluded from the result set. Null values do not match other null values.
titles
and publishers
tables to include all titles, even those you don’t have publisher information for:SELECT titles.title_id, titles.title,
publishers.pub_name
FROM titles LEFT OUTER JOIN publishers ON
titles.pub_id = publishers.pub_id
titles
and publishers
tables will include all publishers, even those who have no titles in the titles
table.titles
and publishers
shows all titles and all publishers, even those that have no match in the other table.Note Some databases, such as Oracle, do not support full outer joins. For details, see Query Designer Considerations for Oracle Databases.
You can also create a self-join, which compares rows within the same table. For example, you can use a self-join to find all publishers that are in a specific city and have the same postal code. For details, see Creating Self-Joins.