COALESCE
On this page
Given a list of values, returns the first non-NULL value.
Syntax
COALESCE ( val, [val, [val ...]])
Arguments
-
val: any object
Return Type
Return the first non-NULL value in the list.
Examples
SELECT COALESCE(NULL, NULL, 1, 2, 3);
+-------------------------------+
| COALESCE(NULL, NULL, 1, 2, 3) |
+-------------------------------+
| 1 |
+-------------------------------+
Last modified: February 24, 2023