Subject | Re: what should i use where or join? whats the difference? |
---|---|
Author | Adam |
Post date | 2005-12-05T22:48:55Z |
--- In firebird-support@yahoogroups.com, Alexandre Benson Smith
<iblist@t...> wrote:
* 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.
Adam
<iblist@t...> wrote:
>that
> Fabio Gomes wrote:
>
> >It can sound stupid, but i m newbie in this sql stuff.. i noticed
> >something like:speed? wich
> >
> >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
> >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.
Adam