IDENTICAL()

Overview

Returns a boolean indicating if two values are equal.

USAGE

IDENTICAL(value1, value2)

Argument Name

Description

value

The two values to compare

DETAILS

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

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 does not take into account the current sort order, so differences in uppercase and lowercase are significant. For a function that can ignore case, see EQ().

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.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT IDENTICAL('ABC', 'abc'), EQ('ABC', 'abc');
+-------------------------+------------------+
| IDENTICAL('ABC', 'abc') | EQ('ABC', 'abc') |
+-------------------------+------------------+
|                       0 |                1 |
+-------------------------+------------------+
-- Disable strict mode or the select might throw an error
SET sql_mode = '';
SELECT IDENTICAL(99, '99a'), IDENTICAL('abc', 0);
+----------------------+---------------------+
| IDENTICAL(99, '99a') | IDENTICAL('abc', 0) |
+----------------------+---------------------+
|                    1 |                   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