数据库ifnull方法

IFNULL(expr1,expr2)
如果expr1不是NULL,IFNULL()返回expr1,否则它返回expr2。IFNULL()返回一个数字或字符串值。例如:

ifnull(sum(t2.played_num),0)

如果sum(t2.played_num)为null,则将其置位0

 
原文地址:https://www.cnblogs.com/cuteCoderSnow/p/10147384.html