--都是要用isnullselect isnull(字符字段,''),isnull(数字字段,0) from 表
--或者:
select case when 字符字段 is null then '' else 字符字段 end
,case when 数字字段 is null then '' else 数字字段 end
from 表
--或者:
select case when 字符字段 is null then '' else 字符字段 end
,case when 数字字段 is null then '' else 数字字段 end
from 表
declare @a varchar(10)
set @a=null
SET CONCAT_NULL_YIELDS_NULL OFF
print '111'+@a+'222'--返回值'111222'
SET CONCAT_NULL_YIELDS_NULL ON
print '111'+@a+'222'--返回NULL