Important
New database features are no longer connected to engine versions; features are now enabled independently during scheduled update windows, and “major” and “minor” releases no longer exist in Helios. Please visit the release notes to view the latest features available in your database clusters.
bitwise NOT (~)
On this page
The bitwise NOT (~) inverts all of the bits of a given number.
This operator is unary, ie, it applies to only one argument.
Syntax
~numReturn Type
Integer
Examples
SELECT ~8, bin(8), bin(~8);
+----------------------+--------+------------------------------------------------------------------+
| ~8 | bin(8) | bin(~8) |
+----------------------+--------+------------------------------------------------------------------+
| 18446744073709551607 | 1000 | 1111111111111111111111111111111111111111111111111111111111110111 |
+----------------------+--------+------------------------------------------------------------------+Last modified: