OR

All functions > LOGICAL > OR

Returns true if at least one argument is true.

Syntax

OR(expr1, expr2)
sql

Arguments

ParameterTypeRequiredDescription
expr1BOOLEANYesFirst boolean expression
expr2BOOLEANYesSecond boolean expression

Returns

TRUE if at least one expression is TRUE, FALSE otherwise

Notes

  • Logical OR operator for boolean expressions
  • Returns TRUE if either or both operands are TRUE
  • Returns FALSE only when both operands are FALSE
  • NULL handling: Returns NULL if both operands are NULL, or one is NULL and the other is FALSE
  • Short-circuit evaluation may apply (expr2 not evaluated if expr1 is TRUE)
  • Can be chained: expr1 OR expr2 OR expr3
  • Commonly used in WHERE clauses for alternative conditions

See also

Last update at: 2025/10/13 10:23:46