SQL Server › Joins
What is a FULL OUTER JOIN, and when would you use one instead of a LEFT or RIGHT JOIN?
IntermediateAnswer
A FULL OUTER JOIN returns all rows from both tables, matching them where possible and filling in NULL values on either side when no match exists, which is useful when you need to see the complete picture from both tables, including unmatched rows from either side, rather than favoring one table over the other.
SELECT c.Name, o.OrderId
FROM Customers c
FULL OUTER JOIN Orders o ON c.CustomerId = o.CustomerId;Real-world example A data reconciliation report uses a FULL OUTER JOIN to compare two systems, showing customers with no matching orders and orders with no matching customers, helping identify data inconsistencies in either direction.