w3resource

MySQL INVERT BITS operator

INVERT BITS operator

MySQL Invert bits operator returns an unsigned 64-bit integer. It inverts all bits.

Syntax:

~

MySQL Version: 8.0

Example:

Code:

SELECT  6 & ~2;

Explanation

The above MySQL statement will return an unsigned integer for specified numbers.

Output:

mysql> SELECT 6 & ~2;
+--------+
| 6 & ~2 |
+--------+
|      4 | 
+--------+
1 row in set (0.02 sec)

Previous: BITWISE AND
Next: BITWISE OR



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/mysql/bit-functions/invert-bits.php