Logical operators¶
Supported datatypes: BOOLEAN
Logical operators allow to chain multiple boolean columns or expressions that return boolean value to obtain more complex logical expressions.
AND
¶
The logical conjunction operator returns TRUE
value if and only if both
inputs are TRUE
.
Input 1 |
Input 2 |
Result |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Examples¶
Simple conjunction of two boolean columns.
SELECT <col_1_bool> AND <col_2_bool>
FROM <table_name>
Negated column syntax.
SELECT <col_1_bool> AND NOT <col_2_bool>
FROM <table_name>
OR
¶
The logical disjunction (or alternative) operator returns TRUE
value if one
of the inputs is TRUE
.
Input 1 |
Input 2 |
Result |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Examples¶
Simple disjunction of two boolean columns.
SELECT <col_1_bool> OR <col_2_bool>
FROM <table_name>
Negated column syntax.
SELECT <col_1_bool> OR NOT <col_2_bool>
FROM <table_name>
NOT
¶
The logical negation operator returns the reverse truth value.
Input |
Result |
---|---|
|
|
|
|
|
|
Example¶
Simple negation of a boolean column.
SELECT NOT <col_1_bool>
FROM <table_name>