Logical XOR (XOR) : XOR : Logic Operator MySQL TUTORIALS


MySQL TUTORIALS » Logic Operator » XOR »

 

Logical XOR (XOR)


'a XOR b' is mathematically equal to (a AND (NOT b)) OR ((NOT a) and b).

Returns NULL if either operand is NULL.

For non-NULL operands, evaluates to 1 if an odd number of operands is non-zero, otherwise 0 is returned.

mysql>
mysql> SELECT XOR 1;
+---------+
XOR |
+---------+
|       |
+---------+
row in set (0.00 sec)

mysql> SELECT XOR 0;
+---------+
XOR |
+---------+
|       |
+---------+
row in set (0.00 sec)

mysql> SELECT XOR 0;
+---------+
XOR |
+---------+
|       |
+---------+
row in set (0.00 sec)

mysql> SELECT XOR XOR 1;
+---------------+
XOR XOR |
+---------------+
|             |
+---------------+
row in set (0.00 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Logic Operator
» XOR