当要查询的某字段下的记录为空时,替换为0或“无”或“未知”如何实现?
使用 (case when ````` is null then "无" else ````` end) as ``````
延伸疑问:如果是1、2、3、4 ,要替换为A、B、C、D的话,
case when id=1 then 'A'
when id=2 then 'B'
when id=3 then 'C'
when id=4 then 'D'
else '其他' end
当要查询的某字段下的记录为空时,替换为0或“无”或“未知”如何实现?
使用 (case when ````` is null then "无" else ````` end) as ``````
延伸疑问:如果是1、2、3、4 ,要替换为A、B、C、D的话,
case when id=1 then 'A'
when id=2 then 'B'
when id=3 then 'C'
when id=4 then 'D'
else '其他' end
本文标题:关于null或者其他内容的替换如何实现?2019-06-25
本文链接:https://www.haomeiwen.com/subject/jthzqctx.html
网友评论