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
ParameterTypeRequiredDescription
expr1BOOLEANYesFirst boolean expression
expr2BOOLEANYesSecond 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 BOOLEANf2 BOOLEANf3 BOOLEANf4 BOOLEAN
falsetruetrueNULL

Last update at: 2026/05/26 17:22:09