DB2 Left Outer Join Statement
LEFT OUTER JOIN will retrieves all the rows from the tables which are provided before LEFT OUTER JOIN keyword and only matched rows from the tables provide after the keyword.
Let us say, A and B table are joining. A has the matching row for a specific value in matching columns and B also should have the row with the matching value. Then only the row will appear in result table.
Let us say, A and B table are joining. A has the matching row for a specific value in matching columns. But B has no row with the matching value. Still the row is joined in OUTER JOIN, but the columns of B will be filled up with NULL values in result table.
SELECT columns-list FROM table-A WHERE condition LEFT OUTER JOIN SELECT columns-list FROM table-B WHERE condition ON joining-column(s)
In the above case, it will retrieve all the rows from table-A and only matched rows from table-B
RIGHT OUTER JOIN Statement DB2 NULL Statement