Home  >  Article  >  Database  >  How does the MySQL NULL safe equals operator perform when used with row comparisons?

How does the MySQL NULL safe equals operator perform when used with row comparisons?

WBOY
WBOYforward
2023-08-23 22:25:051244browse

MySQL NULL 安全等于运算符在与行比较一起使用时如何执行?

When we use the NULL-safe operator in row comparison, such as (A, B) 96b4fef55684b9312718d5de63fb7121 (C, D), its performance is equivalent to ( A 96b4fef55684b9312718d5de63fb7121 C) AND (B 96b4fef55684b9312718d5de63fb7121 D). The following example will illustrate −

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 set shows how to use the NULL safe operator for row comparison.

The above is the detailed content of How does the MySQL NULL safe equals operator perform when used with row comparisons?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete