Subject | Re: [firebird-support] Question on JOINS |
---|---|
Author | Martijn Tonies |
Post date | 2006-01-24T13:28:37Z |
> Between these two statement , which one is faster?No, both queries do not return the same result.
>
> 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
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