1、如果为空返回0 select ifnull(null,0) 2、如果为空返回0,否则返回1 select if(isnull(col),0,1) as col. 转载于:https://www.cnblogs.com/yshyee/p/4023599.html