更多精彩参考大神:https://blog.csdn.net/qq_24549805/article/details/51892651
流程函数
IFNULL(expr1,expr2)
如果expr1不是NULL,返回expr1,否则返回expr2。
例子:select IFNULL(comm,0) + 100 from emp;#可以用于将空值替换为0
原始列 | 执行后 |
---|---|
(Null) | 100 |
300 | 400 |
500 | 600 |
(Null) | 100 |
更多精彩参考大神:https://blog.csdn.net/qq_24549805/article/details/51892651
流程函数
IFNULL(expr1,expr2)
如果expr1不是NULL,返回expr1,否则返回expr2。
例子:select IFNULL(comm,0) + 100 from emp;#可以用于将空值替换为0
原始列 | 执行后 |
---|---|
(Null) | 100 |
300 | 400 |
500 | 600 |
(Null) | 100 |