方法一:
select IF(ISNULL(columnName) OR columnName='',0,columnName) from tableName;
方法二:
select case when ISNULL(columnName) OR columnName='' then 0 else columnName end from tableName;
注:columnName表示字段名称,tableName表示表名称
————————————————
原文链接:https://blog.csdn.net/shenyipeng9889/article/details/100516571