BITXOR Function
The BITXOR function takes two arguments. The arguments can be any number type value that can be converted to an INT8 value.
Fractional values are truncated before the bit operation. The result is the bitwise XOR of its two arguments.
If both arguments have the same integer types, the data type of the returned value is the same type as the arguments. If the arguments are of different integer types (for example, INT and INT8), the returned type is the type with the greater precision. If the arguments are any other numeric type, such as DECIMAL, SMALLFLOAT, FLOAT, or MONEY, or some combination of those types, the returned data type is DECIMAL(32).
The following example illustrates a query that calls the BITXOR function:
SELECT BITXOR(41, 33) AS bitxor FROM systables WHERE tabid = 1;
The following table shows the output of this SELECT statement.
bitxor |
---|
|
This query calls the BITXOR function with negative
arguments:
SELECT BITXOR(-20, -41) AS bitxor FROM systables WHERE tabid = 1;
The following table shows the output of this SELECT statement.
bitxor |
---|
|