BIT_XOR

Purpose

This function computes the bitwise exclusive OR operation of two numerical values. If the two values are different, the result is 1 (true). If the two values are the same, the result is 0 (false). If either value is null, the result is null.

Syntax

bit_xor::=

Bit_Xor

Usage Notes

  • Bit functions are limited to 64 bits, which is positive numbers between 0 and 18446744073709551615.
  • The result data type is DECIMAL(20,0).

Example

-- 1001 XOR 0011 = 1010
SELECT BIT_XOR(9,3);
Result

The result is 10.