Why does null and true
evaluate to null
in PostgreSQL but null or true
evaluates to true
?
I would have thought using null
with and
or or
would've evaluated to null
in both cases?
asked Dec 21, 2017 at 23:27
-
There are some truth tables and details at NULL and three-valued logicbma– bma2017年12月21日 23:48:06 +00:00Commented Dec 21, 2017 at 23:48
1 Answer 1
OR
is defined that if either side istrue
the expression evaluates totrue
.AND
is defined such that if both sides are true boolean-3VL context, the expression evaluates totrue
;null
is not true.
answered Dec 22, 2017 at 1:13
lang-sql