BOOLXOR
functionsupportedCore SQL functionsComputes the Boolean XOR of two numeric expressions; that is, one of the expressions, but not both expressions, is true. In accordance with Boolean semantics: - Non-zero values, including negative numbers, are regarded as true. - Zero values are regarded as false. As a result, the function returns: - True if one expression is non-zero and the other expression is zero. - False if both expressions are non-zero or both expressions are zero. - NULL if one or both expressions are NULL.
Syntax
BOOLXOR( <expr1> , <expr2> )
Parameters
| Name | Required | Description |
|---|---|---|
expr1 | required | A numeric expression. |
expr2 | required | A numeric expression. |
Returns
This function returns a value of type BOOLEAN or NULL.
Usage notes
- This function rounds floating-point numbers. Therefore, it might return unexpected results when it rounds non-zero floating-point numbers to zero.
- For examples of this behavior and workarounds, see Compute Boolean XOR results for floating-point numbers.