On Wed, Jul 14, 2010 at 1:25 PM, Simon Slavin <[email protected]> wrote:
> By the way, can someone explain why this rule, equivalent to line 4 of the
> table, is there:
>
> else if the right op contains NULL, then IN = NULL
>
> By the time we've got there we already know that the left op is not NULL.
> Why does the handling of a NULL right op require a special case like that ?
> We definitely know that the left op is not IN it.
>
NULL should be interpreted as "unknown". Hence in:
5 IN (1,2,3,4,NULL,6,7)
we do *not* definitely know that 5 is not in the RHS. 5 may or may not be
in the RHS depending on what the value of the NULL is. Since we don't know
if 5 is in the RHS, the result of the expression is also unknown, or in
SQL-speak: NULL.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
--
---------------------
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users