|
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Operators for MariaDB Xpand
Topics on this page:
Overview
Bitwise "or".
USAGE
number1 | number2
Value Name | Description |
---|---|
| Two numbers to combine with bitwise "or" |
DETAILS
The |
operator performs a bitwise "or" of two numbers.
If you imagine each number in binary representation aligned by their least-significant bit, a bitwise "or" generates a 1
result bit for each pair of aligned bits that have at least one 1
bit in either value.
The return value is the number representing the union of all the bit positions in the two numbers.
A NULL
is returned if either value is NULL
.
EXAMPLES
SELECT 1 | 4, 1 | 3, 5 | 2;
+-------+-------+-------+
| 1 | 4 | 1 | 3 | 5 | 2 |
+-------+-------+-------+
| 5 | 3 | 7 |
+-------+-------+-------+