OR()
All functions > LOGICAL > OR()
Returns TRUE when at least one boolean operand is TRUE.
Signatures
Returns: TRUE if at least one operand is TRUE; FALSE only when both are FALSE; otherwise NULL (three-valued logic)
OR(expr1: BOOLEAN, expr2: BOOLEAN) → BOOLEAN sql
| Parameter | Type | Required | Description |
|---|---|---|---|
expr1 | BOOLEAN | Yes | First boolean expression |
expr2 | BOOLEAN | Yes | Second boolean expression |
Notes
- Binary only (two arguments); chain with repeated OR for more disjuncts
- Three-valued logic: NULL is unknown — see Related operators for the truth table
Related operators
Examples
OR(expr1, expr2)
FeatureQL
SELECT
f1 := OR(FALSE, FALSE), -- Both false
f2 := OR(TRUE, FALSE), -- One true
f3 := OR(TRUE, NULL::BOOLEAN), -- TRUE absorbs NULL
f4 := OR(FALSE, NULL::BOOLEAN) -- Unknown with FALSE
;Result
| f1 BOOLEAN | f2 BOOLEAN | f3 BOOLEAN | f4 BOOLEAN |
|---|---|---|---|
| false | true | true | NULL |