Home  >  Article  >  Database  >  What does the MySQL COALESCE() function return if all arguments supplied to it are NULL?

What does the MySQL COALESCE() function return if all arguments supplied to it are NULL?

PHPz
PHPzforward
2023-08-29 09:49:02612browse

如果提供给 MySQL COALESCE() 函数的所有参数均为 NULL,它会返回什么?

If all values ​​in the MySQL COALESCE() function are NULL, it returns NULL as output. This means that the function did not find any non-NULL value in the list.

Example

mysql> Select COALESCE(NULL, NULL, NULL, NULL);
+----------------------------------+
| COALESCE(NULL, NULL, NULL, NULL) |
+----------------------------------+
|                             NULL |
+----------------------------------+

1 row in set (0.00 sec)

The above is the detailed content of What does the MySQL COALESCE() function return if all arguments supplied to it are 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
Previous article:Call MySQL programNext article:Call MySQL program