当前位置: 代码迷 >> Sql Server >> 替换字符串有关问题
  详细解决方案

替换字符串有关问题

热度:26   发布时间:2016-04-27 15:15:12.0
替换字符串问题
如何把某列的NULL和 ' '替换成该表的另外一列的值

要SELECT  
不要UPDATE

------解决方案--------------------
select case when col1 is NULL or col1= ' ' then col2 else col1 end from 表
------解决方案--------------------
select (case when col is null or col= ' ' then col1 else col end) as col from table
  相关解决方案