IDENTICAL()
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 boolean indicating if two values are equal.
USAGE
IDENTICAL(value1, value2)
Argument Name | Description |
---|---|
| 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
.
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 |
+----------------------+---------------------+