Subject Re: [firebird-support] what should i use where or join? whats the difference?
Author Alexandre Benson Smith
Fabio Gomes wrote:

>It can sound stupid, but i m newbie in this sql stuff.. i noticed that
>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?
>Sorry if it sound stupid, but i never studied SQL, nor Firebird, i learned
>all by myself, so i use what works, and both works, but i dont know how and
>why it works.
>Thanx for any help.

a join in SQL-89 sintax is like this:

A.A, B.B
A, B

the same using SQL-92 syntax is like this:
A.A, B.B
A join
B on (B.AID = A.AID)

I prefer to use SQL-92 syntax, I have heard that the optimizer works
better with the SQL-92 (not sure at this point).

I prefere it because I think it's easier to read, you know exactly what
is JOIN condition and what is the filter condition (the WHERE clause).

You cannot express OUTER JOINS using the former. The performance should
be the same.

see you !

Alexandre Benson Smith
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil