I think Rudy is on the mark with stating that a "many" table query is easier to read using "joins" than with "where/and" use. It helps in the way you format the query...especially when it comes to looking at it in the future.
I would prefer:
Code:
select
a.selcola,
b.selcolb,
c.selcolc
from
tableA a
inner join
tableB b
on
a.joincol = b.joincol
inner join
tableC c
on
a.joincol = c.joincol
where
b.somecond = 'blah'
over:
Code:
select
a.selcola,
b.selcolb,
c.selcolc
from
tableA a, tableB b, tableC c
where
a.joincol = b.joincol
and a.joincol = c.joincol
and b.somecond = 'blah'
I think you will see that as you add more tables and true WHERE conditionals, the "where/and" method can get ugly fast.
Also, when using "where/and" it is harder to discern the true WHERE conditionals (the "b.somecond = 'blah'" expression) from the necessary table-joining conditionals.
Finally, if you ever need to alter the type of table join, it is typically a bit easier to do with the "join" example as opposed to then having to possibly re-write most of the "where/and" query to get an outer join in there.
BTW, the "where/and" method is an implicit join.
Bookmarks