NOT()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns a negated boolean expression.
USAGE
NOT(value)
Argument Name | Description |
---|---|
| The value to negate |
DETAILS
NOT()
is a function that evaluates the argument as a truth value and then negates the value.
This means that any argument that evaluates as logical true (a non-zero number) returns 0
(false) and any argument that evaluates as logical false (zero) returns 1
(true).
A string is evaluated as a number, which parses any leading numerical content out of the string. A string with no numerical content is parsed as a zero.
A NULL
is returned if the argument is NULL
.
The function call NOT(x)
behaves in exactly the same manner as the operator expression !x
.
EXAMPLES
SELECT NOT(42), NOT(NULL);
+---------+-----------+
| NOT(42) | NOT(NULL) |
+---------+-----------+
| 0 | NULL |
+---------+-----------+
SELECT NOT(PI() = 3);
+---------------+
| NOT(PI() = 3) |
+---------------+
| 1 |
+---------------+