方法1:使用isnull替换
select keyId,isnull(info,0) as info from test
—方法2:使用case when 替换
select keyId,case when info is null then 0 else info end as info from test
—方法3:使用coalesce替换相应的值
select keyId , coalesce(info,0) as info from test
原创文章,作者:506227337,如若转载,请注明出处:https://blog.ytso.com/tech/database/275861.html