Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: SQL JOINs vs WHERE statements

by bean (Monk)
on Aug 18, 2003 at 16:39 UTC ( [id://284634]=note: print w/replies, xml ) Need Help??


in reply to SQL JOINs vs WHERE statements

Just to throw my 2 cents in here...
  1. Yes, they are absolutely equivalent.
  2. I have never seen the verbose syntax (INNER|LEFT|RIGHT|FULL JOIN) used in a professional, production system, probably because Oracle prior to 9i didn't support it. (I had completely forgotten that it existed.)
  3. If you can limit one of the tables on an indexed column before joining, it may be faster. So in your example, if eps_people_roles.ep is indexed, you should do this:
    SELECT people.firstname, people.lastname, role.name FROM people, roles, eps_people_roles WHERE eps_people_roles.ep = 1 AND ( eps_people_roles.role = roles.id AND eps_people_roles.person = people.id )

Update
If you have the JOIN keyword available and it makes the query easier to read, by all means use it. It was added to SQL syntax for a reason...

Replies are listed 'Best First'.
Re: Re: SQL JOINs vs WHERE statements
by Cody Pendant (Prior) on Aug 19, 2003 at 00:05 UTC
    >If you can limit one of the tables on an >indexed column before joining, it may be faster.

    That's a helpful tip, thank you.



    ($_='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://284634]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-23 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found