Important

Helios features are now enabled during weekly update windows and are no longer directly tied to SingleStore engine releases. Refer to the release notes to view the latest features available in your Helios cluster.

bitwise NOT (~)

The bitwise NOT (~) inverts all of the bits of a given number.

This operator is unary, ie, it applies to only one argument.

Syntax

num1 ^ num2

Return Type

Integer

Examples

SELECT ~8, bin(8), bin(~8);
+----------------------+--------+------------------------------------------------------------------+
| ~8                   | bin(8) | bin(~8)                                                          |
+----------------------+--------+------------------------------------------------------------------+
| 18446744073709551607 | 1000   | 1111111111111111111111111111111111111111111111111111111111110111 |
+----------------------+--------+------------------------------------------------------------------+

Last modified:

Was this article helpful?