BITWISE_OR()

All functions > BITWISE > BITWISE_OR()

Returns the bitwise OR of two bitstrings.

Signatures

Returns: Result bitstring, or NULL if either operand is NULL

BITWISE_OR(left: BITSTRING, right: BITSTRING) → BITSTRING
sql
ParameterTypeRequiredDescription
leftBITSTRINGYesLeft operand
rightBITSTRINGYesRight operand

Notes

  • Both operands must have the same length
  • Each bit position is ORed independently: 0 OR 0 = 0, all other combinations = 1
  • Returns NULL if either input is NULL

Related operators

Examples

FeatureQL
SELECT
    f1 := BITWISE_OR('1010'::BITSTRING, '0101'::BITSTRING)::VARCHAR -- Complementary bits produce all 1s
;
Result
f1 VARCHAR
1111

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