|
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/sqlp/rbafFrom: Brian Johnson
AKA full outer join. Not yet directly supported on System i, but IBM
provides an example for simulating one...
we'reymst124.htm
Thanks Brian! This made me do some more research, and I found that in
addition to the FULL OUTER JOIN (which as you indicate is exactly what
looking for), there are also a set of RIGHT JOIN functions, whichbasically
reverse the selection process.file,
A RIGHT EXCEPTION JOIN returns records that only exist in the right
while RIGHT OUTER JOIN includes those records along with records thatexist
in both. This exactly mirrors the LEFT EXCEPTION JOIN AND LEFT OUTERJOIN.
RIGHT
For some databases, LEFT JOIN is a synonym for LEFT OUTER JOIN, while
JOIN is synonymous with RIGHT OUTER JOIN. Note that there is no LEFTINNER
JOIN (or RIGHT INNER JOIN) because an INNER JOIN includes only recordsthat
are contained in both files, so the RIGHT vs. LEFT distinction makes noJOIN,
difference in record selection.
As Brian pointed out, FULL OUTER JOIN returns all records, whether they
exist in both files or not. Interestingly, there is no FULL EXCEPTION
which would return records that only exist in one file or the other, butnot
both (but it's easy to simulate with a UNION of LEFT EXCEPTION and RIGHTshort
EXCEPTION).
Finally, various databases support some or all of these requests. Oracle
supports pretty much everything, although I don't think it likes the
synonyms. You need to consult the documentation for your database to
determine which functions are supported.
Joe
P.S. I won't tell you about CROSS JOIN. You don't want to know.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.