Re: Null in subquery returns no records

From: Lennart Jonsson <lennart_at_kommunicera.umea.se>
Date: 10 Feb 2004 08:28:44 -0800
Message-ID: <6dae7e65.0402100828.3059c01f_at_posting.google.com>


"ben brugman" <ben_at_niethier.nl> wrote in message news:<4028a435$0$1413$4d4ebb8e_at_read.news.nl.uu.net>...
> "Lennart Jonsson" <lennart_at_kommunicera.umea.se> wrote in message >
> > x not in (y1, y2, ..., null) ->
> > not (x=y1 or x=y2 or ... x=null) ->
> > x!=y1 and x!=y2 and ... x!=null ->
> > ... and null ->
> > null
> >
>
> Three valued logic is problematic, but I do not agree with the above.
> Not all conditions containing a null evalutate to null, for example
>
> False AND null evaluates to False
>
> your line ... and null -> null does not 'respect' that rule.
>

In general youre right, but in the context given x!=y[i] evaluates to true. I was a bit sloppy, and left out the last steps of the reduction. What I meant was:

x not in (y1, y2, ..., null) ->
not (x=y1 or x=y2 or ... x=null) ->
x!=y1 and x!=y2 and ... x!=null ->
true and true and ... and null ->
true and null ->
null

[...]

/Lennart Received on Tue Feb 10 2004 - 17:28:44 CET

Original text of this message