Ian Kirkham wrote:
Quote:
Hi Marty,
If you look at the transform, it was deemed invalid if either column was
nullable as there could be a NULL which would be IN the set but which
would be obscured by the transform to a LOJ. In fact, we ought to do the
transform if either column is NOT NULL which is slightly less
restrictive. However, to my mind this is somewhat of a grey area as the
NULL should not be joinable in other contexts. |
It's hard to confidently say anything about nulls because the logic has
never be properly worked out. Furthermore SQL treats them
inconsistently depending on context; sometimes they are taken to mean
some kind of "missing" and other times they are taken to mean some
kind of "doesn't apply".
A rule of thumb that has never let me down is that null is just never
joinable, ever ever ever. (Expecting to join on one or more nulls is
not much different than expecting WHERE random() = random() to be true,
predictable and correct.)
--
Roy
UK Ingres User Association Conference 2010 will be on Tuesday June 8 2010
Go to http://www.iua.org.uk/join to get on the mailing list.