Taking the classic Customer and Orders tables, all types of join return information from both tables as follows:
INNER JOIN
All customers who have orders.
LEFT JOIN
All customers whether or not they've got orders. If a customer has no orders then nulls will be displayed in their order details.
RIGHT JOIN
All orders whether or not they relate to a customer. If an order does not relate to a customer then nulls will be displayed in their customer details.
OUTER JOIN
All customers and all orders. As above, nulls will fill any gaps.
CROSS JOIN
Every customer linked to every order whether or not that order belongs to that customer. Typically generates a huge and useless output set.
yes, when you want rows from both the left and the right tables, including those that match as well as those from either side that don't
for example,
customers with the product they ordered = inner
+
customers who ordered no products = left outer, unmatched
+
products not ordered by any customers = right outer, unmatched
=
full outer join
Is there any practical use for a FULL OUTER join
Access (in fact JetSQL) doesn't supoorts FULL OUTER JOIN).
The workaround is an UNION of a LEFT JOIN and an unmatched RIGHT JOIN.
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.