fulljoin

SQL FULL OUTER JOIN

SQL FULL OUTER JOIN

The FULL OUTER JOIN clause returns all rows when there is a match in one of the tables. It returns NULL on the side that does not have a match.

Example of FULL OUTER JOIN

SELECT Users.first_name, Users.last_name, Orders.order_date
FROM Users
FULL OUTER JOIN Orders ON Users.user_id = Orders.user_id;
    

This query retrieves all users and all orders, combining matching records from both sides and filling in NULL where there is no match.