How MySQL NULL-safe equal operator performs when used with row comparisons?

MySQLMySQLi Database

When we use NULL-safe operator with row comparisons like (A, B) <=> (C, D) then its performance is equivalent to (A <=> C) AND (B <=> D). Following example will demonstrate it −

mysql> Select (100,50) <=> (50,100);
+-----------------------+
| (100,50) <=> (50,100) |
+-----------------------+
|                     0 |
+-----------------------+
1 row in set (0.00 sec)

mysql> Select (100,50) <=> (100,50);
+-----------------------+
| (100,50) <=> (100,50) |
+-----------------------+
|                     1 |
+-----------------------+
1 row in set (0.00 sec)

The above result sets show how NULL-safe operators can be used with row comparison.

raja
Published on 21-Feb-2018 09:39:48
Advertisements