There are two Boolean literals: TRUE and FALSE.
We support the following Boolean operations:
The following truth table defines the OR operator:
| TRUE | FALSE | NULL | |
|---|---|---|---|
| TRUE | TRUE | TRUE | TRUE |
| FALSE | TRUE | FALSE | NULL |
| NULL | TRUE | NULL | NULL |
The following truth table defines the AND operator:
| TRUE | FALSE | NULL | |
|---|---|---|---|
| TRUE | TRUE | FALSE | NULL |
| FALSE | FALSE | FALSE | FALSE |
| NULL | NULL | FALSE | NULL |
The following table defines the NOT operator:
| TRUE | FALSE |
|---|---|
| FALSE | TRUE |
| NULL | NULL |
The following table defines the IS FALSE operator:
| TRUE | FALSE |
|---|---|
| FALSE | TRUE |
| NULL | FALSE |
The following table defines the IS NOT FALSE operator:
| TRUE | FALSE |
|---|---|
| FALSE | TRUE |
| NULL | TRUE |
The following table defines the IS TRUE operator:
| TRUE | TRUE |
|---|---|
| FALSE | FALSE |
| NULL | FALSE |
The following table defines the IS NOT TRUE operator:
| TRUE | FALSE |
|---|---|
| FALSE | TRUE |
| NULL | TRUE |
Casting a string to a Boolean applies the following algorithm:
- whitespaces are trimmed
- string is converted to lowercase
- value 'true' is converted to
TRUE - value 'false' is converted to
FALSE - any other string produces a runtime error
:::info
Notice that not all Boolean operations produce NULL results when an operand is
NULL.