Function | Syntax | Description |
bit_count(x, bits) | Returns the number of ones in x in binary representation. | |
bitwise_and(x, y) | Returns the result of the bitwise AND operation on x and y in binary representation. | |
bitwise_not(x) | Inverts all bits of x in binary representation. | |
bitwise_or(x, y) | Returns the result of the bitwise OR operation on x and y in binary representation. | |
bitwise_xor(x, y) | Returns the result of the bitwise XOR operation on x and y in binary representation. |
bit_count
function is used to return the number of ones in x
.bit_count(x, bits)
Parameter | Description |
x | The parameter value is of the bigint type. |
bits | Number of bits, for example, 64 bits. |
* | SELECT bit_count(24, 64)
2
bitwise_and
function is used to return the result of the bitwise AND operation on x
and y
in binary representation.bitwise_and(x, y)
Parameter | Description |
x | The parameter value is of the bigint type. |
y | The parameter value is of the bigint type. |
* | SELECT bitwise_and(3, 5)
1
bitwise_not
function is used to invert all bits of x
in binary representation.bitwise_not(x)
Parameter | Description |
x | The parameter value is of the bigint type. |
* | SELECT bitwise_not(4)
-5
bitwise_or
function is used to return the result of the bitwise OR operation on x
and y
in binary representation.bitwise_or(x, y)
Parameter | Description |
x | The parameter value is of the bigint type. |
y | The parameter value is of the bigint type. |
* | SELECT bitwise_or(3, 5)
7
bitwise_xor
function is used to return the result of the bitwise XOR operation on x
and y
in binary representation.bitwise_xor(x, y)
Parameter | Description |
x | The parameter value is of the bigint type. |
y | The parameter value is of the bigint type. |
* | SELECT bitwise_xor(3, 5)
6
Was this page helpful?