日期:2014-05-19  浏览次数:20402 次

如何将已存在字段里为空的纪录赋定值?急~~~
如何将表里面,值为空( <NULL> )的字段的所有纪录赋定值??

用查询分析语句怎么写?

我用了这个,但不行,哪里错了呢?

update   表   set   字段名=replace(字段名, 'null ', '2 ')


请高手指教~~~~~




------解决方案--------------------
update 表 set 字段名=isnull(字段名, '2 ')
------解决方案--------------------
update 表 set 字段名=isnull(字段名, '2 ') where 字段名 is null
------解决方案--------------------
update 表 set 字段名=isnull(字段名, '2 ')
where 字段名 is null
如果字段为空,赋值为2,如果不为空,没有变化
------解决方案--------------------
update 表 set 字段名=isnull(字段名, '2 ') where 字段名 is null
你说的为空是没有赋值 还是默认的 " "