Subject Re: [firebird-support] JOINs vs WHERE
Author Martijn Tonies
Hi Steffen,

> I have a question. It is very SQL-basic.
>
> What are JOINs good for?
>
> >From what I read, I can do
>
> select a.avalue, b.bvalue
> from atable a, btable b
> where a.id = b.id
>
> as
>
> select a.avalue, b.bvalue
> from atable a join btable b
> on a.id = b.id
>
> Is there a difference? Until now, I only used the former approch, as it
> seems more "natural" to me.

Use the "JOIN" syntax - it's easier for the optimizer
to get a decent query plan for you. Also, it's more
clear to the reader what's actually going on, and it
gives you the opportunity to do OUTER joins as
well.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com