In db2, null could be anything. But some time when we join tables by using join condition which involves null values, we should remember that :
a.cola = b.colb -- if both are null, the condition is false, that is null = null returns false.
a.cola <> b.colb -- if both are null, the condition is false, that is NULL <> NULL returns False
-
7 = NULL => False
7 > NULL => False
7 <> NULL => False
-
NULL = NULL => False
NULL <> NULL => False
-
NULL IN( 1, NULL, 3) => False
NULL IN (1, 3) => False
1 IN (1, NULL, 3) => True
阅读(343) | 评论(0) | 转发(0) |