首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

替换字符串有关问题

2012-03-14 
替换字符串问题如何把某列的NULL和替换成该表的另外一列的值要SELECT不要UPDATE[解决办法]select case whe

替换字符串问题
如何把某列的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

热点排行
Bad Request.