SQLite COALESCE() Function
Example
Return the first value that is not NULL:
SELECT COALESCE(NULL, NULL, 'SQLite', NULL);
Try it Yourself »
Definition and Usage
The COALESCE() function returns the first of its arguments that is not NULL. If all the arguments are NULL, it returns NULL.
Tip: Also look at IFNULL(), NULLIF().
Syntax
COALESCE(value1, value2, ...)
Parameter Values
| Parameter | Description |
|---|---|
| value1, value2, ... | Required. Two or more values to test |
Technical Details
| Return type: | Same as the returned value |
|---|