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?

王林
王林forward
2023-08-23 22:33:02680browse

如果 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)

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!

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