Operators
Operators are used to compose identifiers and literals into larger expressions. Operators can be logical operators , arithmetic operators, or comparison operators.
Logical Operators
The logical operators are NOT, AND, and OR. These are in precedence order. These
have the usual Boolean logic semantics. If a logical operator is
applied to header fields or properties whose value is NULL, then the following rules
apply:
ANDing aNULLvalue with aFALSEvalue evaluates toFALSE;ANDing aNULLwith aTRUEorNULLvalue evaluates to a NULL (or unknown) value.ORing aNULLvalue with aTRUEvalue evaluates toTRUE;ORing aNULLwith aFALSEor aNULLvalue evaluates to aNULL(or unknown) value.Applying
NOTto aNULLvalue evaluates to aNULL(or unknown) value.
Arithmetic Operators
The arithmetic operators, in precedence order, are + and -
(unary); * and /; and + and -
(binary). These have the usual arithmetic semantics. Any arithmetic
operator that is applied to one or more NULL values evaluates to a NULL value.
Comparison Operators
The comparison operators can be loosely grouped into equality
comparisons and range comparisons. The basic equality comparison
operators, in precedence order, are =, >, >=, <, <=, and <>. These binary operators have to
be applied to two values of the same type, else the expression will
always evaluate to FALSE. If
either value is NULL, then the
result of the comparison is NULL.
There are also the equality operators IS NULL and IS NOT NULL to compare ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access