Subject Re: what should i use where or join? whats the difference?
Author Adam
--- In, Alexandre Benson Smith
<iblist@t...> wrote:
> Fabio Gomes wrote:
> >It can sound stupid, but i m newbie in this sql stuff.. i noticed
> >something like:
> >
> >WHERE X.field=Y.field
> >
> >is the same as:
> >
> >JOIN table X ON (X.field=Y.field)
> >
> >Whats the difference? Wich should i use and why? And what about
speed? wich
> >one is faster?

Your should use the JOIN syntax because

* It is in a more recent version of SQL (92 vs 89)
* it is much easier to read, especially when you join to 10 tables
* You can distinguish between the real conditions of the query and
the columns used to join tables together.
* It gives you the flexibility to include nulls in either table using
left, right or outer join syntax.

Firebird sometimes performs better when the join syntax is used. In
fact migrating conditions which have nothing to do with joining the
tables into the join condition can improve performance when a bad
plan is being used. But even if the performance was equal, I would
still prefer the join syntax due to the above reasons.