'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 1 XOR 1; +---------+ | 1 XOR 1 | +---------+ | 0 | +---------+ 1 row in set (0.00 sec) mysql> SELECT 1 XOR 0; +---------+ | 1 XOR 0 | +---------+ | 1 | +---------+ 1 row in set (0.00 sec) mysql> SELECT 0 XOR 0; +---------+ | 0 XOR 0 | +---------+ | 0 | +---------+ 1 row in set (0.00 sec) mysql> SELECT 1 XOR 1 XOR 1; +---------------+ | 1 XOR 1 XOR 1 | +---------------+ | 1 | +---------------+ 1 row in set (0.00 sec)