Subject Re: [firebird-support] Re: Bug or feature (left join)
Author Arno Brinkman
Hi,

>> Ok, please give 1.5.3 a try.
>> IIRC there was a bug with LEFT JOINs and IS NULL, but only on
> specific conditions.
>
> Both 1.5.3 and 2.0 still have the bug. I entered it to the tracker,
> please see can you reproduce it:
> http://tracker.firebirdsql.org/browse/CORE-1003

With your reproducable case i see what's going on and firebird is correct here.
The LEFT JOIN TAB_Graafik will match 1 record for UID with value 2. This record has '2006-09-20' in the Kuupaev field
and thus with "(((TAB_Graafik.Kuupaev<='31.10.2006') AND (TAB_Graafik.Kuupaev>='01.10.2006')) OR (TAB_Graafik.Kuupaev IS
NULL))" it will be filtered out.
What you want is indeed moving the filtering on Kuupaev into the ON clause, because you want the records from
TAB_Tooleping even if there are no records in TAB_Graafik for the month oktober.

I can't comment in the tracker at this moment.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database developer support:
http://www.databasedevelopmentforum.com

Firebird open source database (based on IB-OE) with many SQL-99 features:
http://www.firebirdsql.org
http://www.firebirdsql.info

Support list for Interbase and Firebird users:
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep:
news://newsgroups.firebirdsql.info