XOR
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Operators for MariaDB Enterprise Server
Topics on this page:
Overview
Logical Exclusive Or operator. Evaluates to 1 if an one operands is non-zero, zero if both are non-zero, NULL if either is NULL.
EXAMPLES
SELECT TRUE XOR TRUE, FALSE XOR FALSE;
+---------------+-----------------+
| TRUE XOR TRUE | FALSE XOR FALSE |
+---------------+-----------------+
| 0 | 0 |
+---------------+-----------------+
SELECT TRUE XOR FALSE, FALSE XOR TRUE;
+----------------+----------------+
| TRUE XOR FALSE | FALSE XOR TRUE |
+----------------+----------------+
| 1 | 1 |
+----------------+----------------+
SELECT 7 XOR 0, 0 XOR 7, 5 XOR 7;
+---------+---------+---------+
| 7 XOR 0 | 0 XOR 7 | 5 XOR 7 |
+---------+---------+---------+
| 1 | 1 | 0 |
+---------+---------+---------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.