Home > Database > Mysql Tutorial > What does the MySQL COALESCE() function return if its first argument is blank but not NULL?

What does the MySQL COALESCE() function return if its first argument is blank but not NULL?

王林
Release: 2023-08-23 22:33:02
forward
742 people have browsed it

如果 MySQL COALESCE() 函数的第一个参数为空白但不是 NULL,它会返回什么?

MySQL COALESCE() function returns null if the first parameter is null. This is because null is also a non-NULL value, and we know that the COALESCE function always returns the first non-NULL value as a result. The following example will demonstrate this situation −

Example

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

The above is the detailed content of What does the MySQL COALESCE() function return if its first argument is blank but not NULL?. 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