Right Outer Join
RIGHT [OUTER] JOIN means that record combinations from both source tables meeting a specified condition should be included in the query result. Besides this, records from the second source (to the right of the word JOIN) that have no records meeting the condition in the first source should be included in the query result.
So, all records from the second source will be included in the query result; these will be joined with the records from the first source which meet the specified condition. Query result strings without records meeting the condition from the first source will contain NULL in the fields formed based on the records from this source.
OUTER keyword is optional; it is only used to improve the clarity and readability of the query text.
Example:
// All banks should be output in the report, while for banks
// that are also contractors a reference to the contractor should be given.SELECT
Contractors.Ref AS Contractor,
Banks.Ref AS BankFROM
Catalog.Contractors AS ContractorsRIGHT OUTER JOIN
Catalog.Banks AS BanksBY
Contractors.Description = Banks.Description
Query result:
Contractor
Bank
NULL
Ivest Bank
Promstroibank
Promstroibank
See also:
Inner Join
Left Outer Join
Full Outer Join