ESQL provides the following logical operators:
NULL and UNKNOWN values are treated as special values by these operators. The principles are:
The result of AND and OR operations is defined by the following table.
Value of P | Value of Q | Result of P AND Q | Result of P OR Q |
---|---|---|---|
TRUE | TRUE | TRUE | TRUE |
TRUE | FALSE | FALSE | TRUE |
TRUE | UNKNOWN | UNKNOWN | TRUE |
FALSE | TRUE | FALSE | TRUE |
FALSE | FALSE | FALSE | FALSE |
FALSE | UNKNOWN | FALSE | UNKNOWN |
UNKNOWN | TRUE | UNKNOWN | TRUE |
UNKNOWN | FALSE | FALSE | UNKNOWN |
UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
The result of NOT operations is defined by the following table.
Operand | Result of NOT |
---|---|
TRUE | FALSE |
FALSE | TRUE |
UNKNOWN | UNKNOWN |