Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2023-08-23 22:25:05
forward
1280 people have browsed it

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

When we use the NULL-safe operator in row comparison, such as (A, B) <=> (C, D), its performance is equivalent to ( A <=> C) AND (B <=> 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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template