IS NOT
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Operators for MariaDB Xpand
Topics on this page:
Overview
Negated boolean comparison.
USAGE
expression IS NOT TRUE|FALSE|UNKNOWN
Value Name | Description |
---|---|
| A value expression |
DETAILS
The IS NOT
operator returns a truth value for one of 3 negated boolean comparisons:
x IS NOT TRUE
checks if the expression does not evaluate toTRUE
(is not a non-zero value)x IS NOT FALSE
checks if the expression does not evaluate toFALSE
(is not a zero value)x IS NOT UNKNOWN
checks if the expression has a known value (is notNULL
)
The return value is always 1
(true) or 0
(false). Evaluating a NULL
value does not return NULL
because this operator considers it to be UNKNOWN
and never TRUE
or FALSE
.
See IS for the positive version of these comparisons.
EXAMPLES
SELECT 1 IS NOT TRUE, 1 IS NOT FALSE, 1 IS NOT UNKNOWN;
+---------------+----------------+------------------+
| 1 IS NOT TRUE | 1 IS NOT FALSE | 1 IS NOT UNKNOWN |
+---------------+----------------+------------------+
| 0 | 1 | 1 |
+---------------+----------------+------------------+
SELECT 0 IS NOT TRUE, 0 IS NOT FALSE, 0 IS NOT UNKNOWN;
+---------------+----------------+------------------+
| 0 IS NOT TRUE | 0 IS NOT FALSE | 0 IS NOT UNKNOWN |
+---------------+----------------+------------------+
| 1 | 0 | 1 |
+---------------+----------------+------------------+
SELECT NULL IS NOT TRUE, NULL IS NOT FALSE, NULL IS NOT UNKNOWN;
+------------------+-------------------+---------------------+
| NULL IS NOT TRUE | NULL IS NOT FALSE | NULL IS NOT UNKNOWN |
+------------------+-------------------+---------------------+
| 1 | 1 | 0 |
+------------------+-------------------+---------------------+
SELECT 42 != TRUE, 42 IS NOT TRUE;
+------------+----------------+
| 42 != TRUE | 42 IS NOT TRUE |
+------------+----------------+
| 1 | 0 |
+------------+----------------+