BOOLAND
functionsupportedCore SQL functionsComputes the Boolean AND of two numeric expressions. 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 both expressions are non-zero. - False if both expressions are zero or one expression is zero and the other expression is non-zero or NULL. - NULL if both expressions are NULL or one expression is NULL and the other expression is non-zero.
Syntax
BOOLAND( <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 AND results for floating-point numbers.