NULLEQ()

Overview

Returns a boolean indicating if two values are equivalent, even NULL values.

USAGE

NULLEQ(value, value)

Argument Name

Description

value

The two values to compare

DETAILS

NULLEQ() is a function that returns 1 or 0 to indicate if two values are equivalent.

If at least one argument is a number, a numeric comparison is performed. Thus, a string argument is converted into a number when paired with a numeric argument.

When both arguments are strings, the comparison takes into account the current sort order, which might treat uppercase and lowercase letters as equivalent. For a function that does not ignore case, see IDENTICAL().

The return value is 1 if the two arguments are equal.

The return value is 0 if the two arguments are not equal.

Comparing a NULL value returns a normal boolean integer, with NULL only matching another NULL.

See also EQ().

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT NULLEQ(99, 123),
       NULLEQ(PI(), 3.141592653589793) AS pi_eq;
+-----------------+-------+
| NULLEQ(99, 123) | pi_eq |
+-----------------+-------+
|               0 |     1 |
+-----------------+-------+
-- Disable strict mode or the select might throw an error
SET sql_mode = '';
SELECT NULLEQ(99, '99a'), NULLEQ('abc', 0);
+-------------------+------------------+
| NULLEQ(99, '99a') | NULLEQ('abc', 0) |
+-------------------+------------------+
|                 1 |                1 |
+-------------------+------------------+
SELECT NULLEQ(5, NULL), NULLEQ(NULL, NULL);
+-----------------+--------------------+
| NULLEQ(5, NULL) | NULLEQ(NULL, NULL) |
+-----------------+--------------------+
|               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