COALESCE() is a function that returns the first value that is not null within a list.

Structure

SELECT COALESCE(value1, value2, value3, ...);

Examples

SELECT COALESCE(NULL, 'a', 1, NULL); //a

SELECT COALESCE(NULL, NULL, NULL, 'b'); //b