The following query uses a full outer join to return all rows from the customers
table and all rows from the orders table. Rows that do not satisfy the ON condition are extended with nulls:SELECT c.customer_id, c.o.order_id, c.account_mgr_id, o.sales_rep_id
FROM customers c FULL OUTER JOIN orders o
ON c.customer_id = o.customer_id
ORDER BY c.customer_id;
CUSTOMER_ID ORDER_ID ACCOUNT_MGR_ID SALES_REP_ID
----------- ---------- -------------- ------------
133 149
134
135
136 149
137 149
138 149
139
140
141 2377 145
142 2378 149
143 2380 149
144 2435 149 159
144 2445 149 158
144 2363 149
144 2422 149 153
144 2382 149
145 2455 145 160
...