w3resource

MySQL BITWISE XOR Operator

BITWISE XOR Operator

MySQL bit wise XOR operator returns an unsigned 64-bit integer.

Syntax:

^

Example:

Code:

SELECT  2 ^ 15

Explanation

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

Sample Output:

mysql> SELECT  2 ^ 15;
+--------+
| 2 ^ 15 |
+--------+
|     13 | 
+--------+
1 row in set (0.00 sec)

Example:

Code:

SELECT  15 ^ 15;

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

Sample Output:

mysql> SELECT  15 ^ 15;
+---------+
| 15 ^ 15 |
+---------+
|       0 | 
+---------+
1 row in set (0.00 sec)

Previous: BITWISE OR
Next: LEFT shift and RIGHT shift



Follow us on Facebook and Twitter for latest update.




We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook