当前位置: 代码迷 >> Sql Server >> 用UPDATE 语句成NULL,请教该怎么
  详细解决方案

用UPDATE 语句成NULL,请教该怎么

热度:97   发布时间:2016-04-27 19:54:43.0
用UPDATE 语句成NULL,请问该如何?
update   icu   set   anum=case   anum   when   0   then   is   null

这样是错的..请问怎样?

------解决方案--------------------
update icu set anum=case anum when 0 then null end

直接 null 就好
------解决方案--------------------
--如果仅仅是将0更新成NULL,这样好一点
update icu set anum=null where anum = 0
------解决方案--------------------
楼上正解
  相关解决方案