image.png
image.png
image.png
当要查询的某字段下的记录为空时,替换为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
图片发自简书App