Топ-100
 
CerebroSQL

COALESCE

Database: MySQL
Topic

Syntax:
COALESCE(value,...)

Returns the first non-NULL value in the list, or NULL if there are no
non-NULL values.

The return type of COALESCE() is the aggregated type of the argument
types.

URL: https://dev.mysql.com/doc/refman/8.0/en/comparison-operators.html

Example

mysql> SELECT COALESCE(NULL,1);
-> 1
mysql> SELECT COALESCE(NULL,NULL,NULL);
-> NULL