SQL FULL JOIN
SQL FULL JOIN (FULL OUTER JOIN) always contains all records of left table (Table A) and right table (Table B) even of join condition does not find any matching record in both left or right table. Returned result contains set NULL value for all column that are lack of value in matching rows.
Example Table
Considering following SQL FULL JOIN example, category
, product
is our example table.
|
|
Example
SQL> SELECT *
FROM product FULL OUTER JOIN category
ON product.category_id = category.category_id;
CATEGORY_ID PRODUCT_NAME CATEGORY_ID CATEGORY_NAME
----------- ------------------------- ----------- -------------------------
1 Samsung 1 Mobiles
1 Nokia 1 Mobiles
2 Dell 2 Laptops
2 HP 2 Laptops
3 Apple 3 Tablet
4 Nikon 4 Cameras
NULL Playstation NULL NULL
NULL NULL 5 Gaming
8 rows selected.