IS

USAGE

expression IS TRUE|FALSE|UNKNOWN

Value Name

Description

expression

A value expression

DETAILS

The IS operator returns a truth value for one of 3 boolean comparisons:

  • x IS TRUE checks if the expression evaluates to TRUE (a non-zero value)

  • x IS FALSE checks if the expression evaluates to FALSE (a zero value)

  • x IS UNKNOWN checks if the expression has no known value (is NULL)

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 NOT for the negated version of these comparisons.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT 1 IS TRUE, 1 IS FALSE, 1 IS UNKNOWN;
+-----------+------------+--------------+
| 1 IS TRUE | 1 IS FALSE | 1 IS UNKNOWN |
+-----------+------------+--------------+
|         1 |          0 |            0 |
+-----------+------------+--------------+
SELECT 0 IS TRUE, 0 IS FALSE, 0 IS UNKNOWN;
+-----------+------------+--------------+
| 0 IS TRUE | 0 IS FALSE | 0 IS UNKNOWN |
+-----------+------------+--------------+
|         0 |          1 |            0 |
+-----------+------------+--------------+
SELECT NULL IS TRUE, NULL IS FALSE, NULL IS UNKNOWN;
+--------------+---------------+-----------------+
| NULL IS TRUE | NULL IS FALSE | NULL IS UNKNOWN |
+--------------+---------------+-----------------+
|            0 |             0 |               1 |
+--------------+---------------+-----------------+
SELECT 42 = TRUE, 42 IS TRUE;
+-----------+------------+
| 42 = TRUE | 42 IS TRUE |
+-----------+------------+
|         0 |          1 |
+-----------+------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES