Categories:

Conditional expression functions

BOOLNOTΒΆ

Computes the Boolean NOT of a single numeric expression. 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 the expression is zero.

  • False if the expression is non-zero.

  • NULL if the expression is NULL.

See also:

BOOLAND , BOOLOR , BOOLXOR

SyntaxΒΆ

BOOLNOT( expr )
Copy

ExamplesΒΆ

SELECT BOOLNOT(0), BOOLNOT(10), BOOLNOT(-3.79), BOOLNOT(NULL);

+------------+-------------+----------------+---------------+
| BOOLNOT(0) | BOOLNOT(10) | BOOLNOT(-3.79) | BOOLNOT(NULL) |
|------------+-------------+----------------+---------------|
| True       | False       | False          | NULL          |
+------------+-------------+----------------+---------------+
Copy