Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: SQL JOINs vs WHERE statements

by Cody Pendant (Prior)
on Aug 18, 2003 at 04:58 UTC ( #284484=note: print w/replies, xml ) Need Help??


in reply to Re: SQL JOINs vs WHERE statements
in thread SQL JOINs vs WHERE statements

Thank you. But, just because I like everything spelled out as if I was hungover and not very smart, are the two statements exactly the same in effect?

Is there perhaps some other kind of consideration like efficiency or speed involved? I'm guessing not.

And why "inner" anyway? I just do not get the meaning of inner and outer in this context. I know what they mean, but I don't know why they have those names.



($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print

Replies are listed 'Best First'.
Re: Re: Re: SQL JOINs vs WHERE statements
by NetWallah (Canon) on Aug 18, 2003 at 05:29 UTC
    I'm at the fringes of my SQL knowledge here (after all - my handle is NETWallah, not SQL-wallah). Anyway - Yes, AFAIK, the performance of both your SQL statements should be the same. To verify, you could have your SQL platform give you the SQL execution plan for each, and compare them.

    Here is the (Thankfully brief) INNER join vs others explanation from Microsoft - it may provide a little insight into the choice of words:

    INNER
    Specifies that all matching pairs of rows are returned. Discards unmatched rows from both tables. This is the default if no join type is specified.

    LEFT [ OUTER ]
    Specifies that all rows from the left table not meeting the specified condition are included in the result set in addition to all rows returned by the inner join. Output columns from the left table are set to NULL.

    RIGHT [ OUTER ]
    Specifies that all rows from the right table not meeting the specified condition are included in the result set in addition to all rows returned by the inner join. Output columns from the right table are set to NULL.

    FULL [ OUTER ]
    If a row from either the left or right table does not match the selection criteria, specifies the row be included in the result set, and output columns that correspond to the other table be set to NULL. This is in addition to all rows usually returned by the inner join.

Re: Re: Re: SQL JOINs vs WHERE statements
by arthas (Hermit) on Aug 18, 2003 at 08:13 UTC

    Is there perhaps some other kind of consideration like efficiency or speed involved? I'm guessing not.

    They should really be the same statement. The only difference is that in the second the join is implicit, but besides the "visual" things nothing else changes.

    Michele.

      I'm relieved to hear it.

      As those who were putting up with me on the CB today will know, there's something about the JOIN syntax that I just can't get my head around. I'm a very visually-oriented person and I don't have a mental picture that works for me.

      Thank you all for your help.



      ($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://284484]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2022-09-26 13:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (117 votes). Check out past polls.

    Notices?