Inner join — Supported in all statements capable of reading multiple tables, including the
FOR,
DO,
REPEAT, and
OPEN QUERY statements. An
inner join returns the records selected for the table (or join) on the left side combined with the related records selected from the table on the right. For any records not selected from the right-hand table, the join returns no records from either the left or right sides of the join. Thus, only related records that are selected from both sides are returned for an inner join. The
Figure 3 figure shows an example of inner joins.
Left outer join — Supported only in the
OPEN QUERY statement. A
left outer join returns the records selected for an inner join. In addition, for each set of records selected from the table (or join) on the left side, a left outer join returns the
Unknown value (?) from the table on the right where there is no record selected or otherwise related to the records on the left. That is, records from the left-hand table (or join) are preserved for all unmatched records in the right-hand table. The
Figure 4 figure shows an example of left outer joins using the same tables as in the
Figure 3 figure.