Logical operators
Vertica supports the logical operators AND, OR, and NOT:.
Vertica supports the logical operators AND, OR, and NOT:
-
AND evaluates to true when both of the conditions joined by AND are true.
-
OR evaluates to true when either condition is true.
-
NOT negates the result of any Boolean expression.
AND and OR are commutative—that is, you can switch left and right operands without affecting the result. However, the order of evaluation of sub-expressions is not defined. To force evaluation order, use a CASE construct.
Caution
Do not confuse Boolean operators with the Boolean predicate or Boolean data type, which can have only two values: true and false.Logic
SQL uses a three-valued Boolean logic where NULL
represents "unknown":
-
true
ANDNULL
=NULL
-
true
ORNULL
=true
-
false
ANDNULL
=false
-
false
ORNULL
=NULL
-
NULL
ANDNULL
=NULL
-
NULL
ORNULL
=NULL
-
NOT
NULL
=NULL