Skip to main content

XOR

Description

Performs a bitwise XOR operation on two BOOLEAN values.

Syntax

<lhs> XOR <rhs>

Parameters

  • <lhs>: The first BOOLEAN value for the bitwise XOR operation.
  • <rhs>: The second BOOLEAN value for the bitwise XOR operation.

Return Value

Returns the XOR value of the two BOOLEAN values.

Examples

  1. Example 1
    select true XOR false, true XOR true;
    +----------------+---------------+
    | true XOR false | true XOR true |
    +----------------+---------------+
    | 1 | 0 |
    +----------------+---------------+
  2. NULL argument
    select true XOR NULL, NULL XOR true, false XOR NULL, NULL XOR false, NULL XOR NULL;
    +---------------+---------------+----------------+----------------+---------------+
    | true XOR NULL | NULL XOR true | false XOR NULL | NULL XOR false | NULL XOR NULL |
    +---------------+---------------+----------------+----------------+---------------+
    | NULL | NULL | NULL | NULL | NULL |
    +---------------+---------------+----------------+----------------+---------------+