1select case when字段 is null then'none'else字段 end as字段, count(1) as counts from表 group by字段;
1.2 当当前字段为空字符串,查询结果返回“none”,并且统计出现频率
1select case when字段= ''then'none'else字段 end as字段, count(1) as counts from表 group by字段;
个人帐户查询1.3 当当前字段为空,查询结果返回“none”
1select case when字段 is null then'none'else字段 end as字段 from表;
1.4 当当前字段为空字符,查询结果返回“none”
1select case when字段= ''then'none'else字段 end as字段 from表;
2 ⼩结
仅作为记录使⽤,mysql其它相关命令有isnull,ifnull and nullif。
发布评论