IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Nope, they're really more kind'a the same thing.
Bryce never fully grokked relational joins:
I always thot that inner/outer was *orthogonal* to left/right. Outer joins fill in non-matches with nulls IIRC while inner skips non-matches.
Yup. And, what does it *do* with those rows from one table that it "makes up" nulls for? Why, it "matches" them to those rows from the other table that there is no real match for. But which is which??? Which table does it seek (and "fake") matches _for_, and which one does it present its fakes as "coming" _from_?

That's what you tell it with "LEFT" or "RIGHT" (or "FULL"). You *can't* specify outer/inner without telling it that, too -- ex- or implicitly -- so they are *not* orthogonal (=independent).


The left/right clause tells it which direction to join at. The default is "inner" if you don't specify inner/outer and the default is "left" if you don't specify left/right.
Don't think of it as a two-dimensional "grid", but a one-dimensional "strip": Draw two overlapping circles (or better yet, make them elongated, ellipses) to represent your tables. Orient them horizontally, mark them A and B if you want, and/or fill them in with different hash patterns or colours.

Now, an "INNER" join will be the cross-hatched (and/or colour-blended) area in the middle (the inner-most one!), while the "LEFT" and "RIGHT OUTER" ones are that inner area plus the rest of one circle (can't remember which direction means which circle, though), i.e, one whole circle and stuff to match *some* of it from the other one; and the "FULL OUTER" join will be the whole shebang, both circles including their common area.

If you drew them elongatedly enough (=stretched out in one dimension), you'll see that it's just one continuum of data you get to select from, and the inner/outer specification *together with* the left/right/full specification decides what you select, "from where to where" along your strip of paper.

Or, to put it another way: If "LEFT" / "RIGHT" were orthogonal from "OUTER" / "INNER", you ought to be able to combine, say, a "LEFT INNER" query. But your only legal alternatives are "LEFT OUTER", "RIGHT OUTER", "FULL OUTER", and "INNER" -- so they aren't independent.

HTH!


IIRC :-)
Well, you might be *remembering* it correctly... But if so, then *what* you're remembering is -- how you got it wrong in the first place.

Sorry, but that's just the way it is.
   Christian R. Conrad
Of course, who am I to point fingers? I'm in the "Information Technology" business, prima facia evidence that there's bats in the bell tower.
-- [link|http://z.iwethey.org/forums/render/content/show?contentid=27764|Andrew Grygus]
New Anybody ever do a FULL OUTER ?
>> That's what you tell it with "LEFT" or "RIGHT" (or "FULL"). You *can't* specify outer/inner without telling it that, too -- ex- or implicitly -- so they are *not* orthogonal (=independent). <<

Okay, perhaps "orthogonal" is too strong a word in that they affect the final application of the other. However, the left/right is mostly about which direction to *apply* the other. IOW, They are still very different things.


>> Draw two overlapping circles (or better yet, make them elongated, ellipses) to represent your tables. Orient them horizontally, mark them A and B if .... <<

Time to get out the construction paper........tomarrow.

>>.... "LEFT INNER" query. But your only legal alternatives are "LEFT OUTER", "RIGHT OUTER", "FULL OUTER", and "INNER" -- so they aren't independent. <<

I always thot "LEFT INNER" simply ignored the LEFT (or RIGHT). However, I never tried it. Nor a FULL OUTER. Anybody here ever need that?

I betcha did on your honeymoon.

It is sort of like comparative operations (x > y). The order (left/right) *does* matter *in general*. However, equality (==) is a special case where it does *not* matter. "Inner" is in the same camp as equality comparisons as far as I am concerned. Thus, I conceptually consider INNER a "spacial case".
________________
oop.ismad.com
Expand Edited by tablizer Feb. 21, 2002, 01:54:34 PM EST
New I like that description.
It's really good - makes the different options make sense. Thanks!

Oh - and Bryce, "Left Outer" vs "Right Outer" is really a semantic convenience. You should theoretically always be able to make a Right Outer Join into a Left Outer Join by swapping the table names in the Join clause. I've not tried it, though, as probably 99% of the Joins I do are Inner.

Wade.

"All around me are nothing but fakes
Come with me on the biggest fake of all!"

New You're welcome! (Both of you... ;^)
     Question on LEFT JOIN - (drewk) - (12)
         An unspecified joining query *is* a left join - (kmself) - (8)
             Hmm, I don't think so - (drewk) - (7)
                 No, "JOIN [tables] ON [condition]" is Standard SQL-92 AFAIK. -NT - (CRConrad)
                 Left Join. - (static) - (5)
                     re: inner/outer left/right joins - (tablizer) - (4)
                         Nope, they're really more kind'a the same thing. - (CRConrad) - (3)
                             Anybody ever do a FULL OUTER ? - (tablizer)
                             I like that description. - (static) - (1)
                                 You're welcome! (Both of you... ;^) -NT - (CRConrad)
         been a long time but wouldnt a stripped seek be faster - (boxley) - (2)
             Gaah, just got the answer - (drewk) - (1)
                 Yup. The speed depends more on the dataset - (tseliot)

I don't know what "puerile twaddle" means.
65 ms