Subject Re: [firebird-support] Question on JOINS
Author Martijn Tonies
> Between these two statement , which one is faster?
>
> SELECT C1,C2... FROM TableA
> JOIN TableB ON TableA.PK=TableB.FK
>
> or
>
> SELECT C1,C2... FROM TableA
> LEFT JOIN TableB ON TableA.PK=TableB.FK
>
> Both queries return the same result, FK is the Foreign key for PK

No, both queries do not return the same result.

In your case, both queries - apparently - happen to return
the same result, which is different.

If TableA has rows that have no match in TableB, those
rows are returned as well in the second query.

Have you been reading our replies?

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com