mysql查询字段为null 返回0 SELECT IF(字段 IS NULL,0, 字段) as 重命名 From xxx SELECT IF(LENGTH(visit_no)>0,1,0) as 重命名 From xxx