The LEFT OUTER JOIN returns all records of the left table and matching records of the right table. When no match is found right table columns will be returned with the null values.

Syntax:

SELECT <em>columnList </em>FROM <em>table1 </em>LEFT OUTER JOIN <em>table2 </em>ON t<em>able1.columnName </em>= <em>table2.columnName</em>;

or

SELECT <em>columnList </em>FROM <em>table1 LEFT</em> JOIN <em>table2 </em>ON t<em>able1.columnName </em>= <em>table2.columnName</em>;

Example:

SELECT P_ID, NAME, AMOUNT
 
FROM PERSONS
 
LEFT OUTER JOIN ORDERS
 
ON PERSONS.P_ID = ORDERS.PERSON_ID;

Output:

P_ID	NAME	AMOUNT
3	deepak	25000
3	deepak	23000
2	sandy	22000
2	sandy	30000
4	Ashish	-
1	jai	-