MySQL IFNULL function

The IFNULL() function is used to determine whether the first expression is NULL, if it is NULL, it returns the value of the second parameter, if it is not NULL, it returns the value of the first parameter.

SELECT IFNULL(1,2) FROM DUAL;

  Output result:

1
SELECT IFNULL(NULL,2) FROM DUAL;

 Output result:

2

 

Guess you like

Origin blog.csdn.net/y_bccl27/article/details/114872520