日期:2014-05-18  浏览次数:20815 次

怎样将数据库中某项为NULL查找出来用""代替?
如题,谢谢

------解决方案--------------------
select '' as b
from dbo.Table_1
where b is null
------解决方案--------------------
估计你要的比这个复杂
------解决方案--------------------
replace 
when null then ""
------解决方案--------------------
case when语句

select case when b = null then '' else b end from tb
b是tb的一个字段
------解决方案--------------------
select isnull(字段名, '') as A from 表名
------解决方案--------------------
update talbe set 某项='' where 某项 is null
------解决方案--------------------
hzg_1998 正解
------解决方案--------------------
用isnull 函数
hzg_1998 正解
------解决方案--------------------
建议在查询出来前用select时就先用isnull转换好

如果已经查询出来那可以用 (value==DBNull.Value?"":value)
------解决方案--------------------
isnull