MySQL COALESCE Function Returns When All Arguments are NULL



If all the values in MySQL COALESCE() function are NULL then it returns NULL as the output. It means that this function does 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)
Updated on: 2020-02-10T08:11:47+05:30

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements