select case field
when ‘’ then ‘指定一个值’
when '未知’then ‘指定一个值’
else field end
from table
这种方式遇到null时就不太好使了 当遇到值为null 的情况时这样用
select case when field =’’ then ‘指定一个值’ when field is null then ‘指定一个值’
else field end from table
原文链接:https://blog.csdn.net/wang740209668/article/details/49686249