Home > Database > Mysql Tutorial > How does MySQL evaluate an expression if the parameters in NULLIF() are not equal?

How does MySQL evaluate an expression if the parameters in NULLIF() are not equal?

WBOY
Release: 2023-09-01 16:09:11
forward
730 people have browsed it

如果 NULLIF() 中的参数不相等,MySQL 如何计算表达式?

We know that the MySQL NULLIF() control flow function will return the first parameter, and the two parameters are not the same. Returns the first argument because MySQL evaluates the first argument twice if the two arguments are not the same.

Example

mysql> Select NULLIF('Tutorialspoint','MySQL');
+----------------------------------+
| NULLIF('Tutorialspoint','MySQL') |
+----------------------------------+
| Tutorialspoint                   |
+----------------------------------+
1 row in set (0.00 sec)
Copy after login

In the above example, since the parameters are not the same, MySQL evaluates the first parameter, i.e. "Tutorialspoint", twice and returns it as output.

The above is the detailed content of How does MySQL evaluate an expression if the parameters in NULLIF() are not equal?. 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