OR

All functions > LOGICAL > OR

Returns TRUE when at least one boolean operand is TRUE.

Syntax

expr1 OR expr2  ·  OR(expr1, expr2)

Notes

  • Chains as nested binary OR: a OR b OR c groups as (a OR b) OR c
  • AND binds tighter than OR
  • Three-valued logic: TRUE with NULL yields TRUE; FALSE with NULL yields NULL; both NULL yields NULL

Related Functions

Examples

expr1 OR expr2

FeatureQL
SELECT
    f1 := FALSE OR TRUE, -- Infix one true
    f2 := FALSE OR FALSE, -- Infix both false
    f3 := TRUE OR NULL::BOOLEAN, -- Infix TRUE absorbs NULL
    f4 := FALSE OR NULL::BOOLEAN -- Infix unknown with FALSE
;
Result
f1 BOOLEANf2 BOOLEANf3 BOOLEANf4 BOOLEAN
truefalsetrueNULL

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