Subject | Re: Bug or feature (left join) |
---|---|
Author | ainpoissee |
Post date | 2006-11-20T16:43:18Z |
--- In firebird-support@yahoogroups.com, "Arno Brinkman"
<fbsupport@...> wrote:
Makes sense... kind of.
IMHO the JOIN ON clause should be used only to define relation between
tables. The TAB_Graafik.Kuupaev field isn't part of the relation, it's
a part of the filter and thus belongs into WHERE. So in my head I
"compiled" it like "no matching TAB_Graafik.Kuupaev for given month so
it is NULL and OR(TAB_Graafik.Kuupaev IS NULL) takes care of it".
Do other (major) RDBs work like FB in such a case? Or is this modus
operandi even SQL standard?
ain
<fbsupport@...> wrote:
>correct here.
> With your reproducable case i see what's going on and firebird is
> 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.clause, because you want the records from
> What you want is indeed moving the filtering on Kuupaev into the ON
> TAB_Tooleping even if there are no records in TAB_Graafik for themonth oktober.
Makes sense... kind of.
IMHO the JOIN ON clause should be used only to define relation between
tables. The TAB_Graafik.Kuupaev field isn't part of the relation, it's
a part of the filter and thus belongs into WHERE. So in my head I
"compiled" it like "no matching TAB_Graafik.Kuupaev for given month so
it is NULL and OR(TAB_Graafik.Kuupaev IS NULL) takes care of it".
Do other (major) RDBs work like FB in such a case? Or is this modus
operandi even SQL standard?
ain