ORBITS()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns a bitwise "or" of two numbers.
USAGE
ORBITS(number1, number2)
Argument Name | Description |
---|---|
| Two numbers to combine with bitwise "or" |
DETAILS
ORBITS()
is a bitwise function that 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 argument is NULL
.
EXAMPLES
SELECT ORBITS(1, 4), ORBITS(1, 3), ORBITS(5, 2);
+--------------+--------------+--------------+
| ORBITS(1, 4) | ORBITS(1, 3) | ORBITS(5, 2) |
+--------------+--------------+--------------+
| 5 | 3 | 7 |
+--------------+--------------+--------------+