outer join
outer join
(database)For example, if we want to list all employees and theiremployee number, but not all employees have a number, then wecould say (in SQL-92 syntax, as used by Microsoft SQL Server):
SELECT employee.name, empnum.numberFROM employeeLEFT JOIN empnum ON employee.id = empnum.id
or, in Sybase syntax:
SELECT employee.name, empnum.numberFROM employee, empnumWHERE employee.id *= empnum.id
The "*" on the left means "left outer join". "*=*" would be afull outer join.
In Oracle syntax:
SELECT employee.name, empnum.numberFROM employee, empnumWHERE employee.id = empnum.id (+)
Note that the "(+)" on the right means "left outer join".
These all mean that all rows from the left-hand "employee"table will appear in the result, even if there is no match fortheir ID in the empnum table. Where there is no empnum.idequal to a given employee.id, a result row is output anywaybut with all result columns from the empnum table null(empnum.number in this case).