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
| Parameter | Type | Required | Description |
|---|---|---|---|
left | BITSTRING | Yes | Left operand |
right | BITSTRING | Yes | Right 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 |
On this page