sql 类似isnull的这个功能

如果这个值为0,就将值设置为1

作者: a79361360   发布时间: 2011-06-15

SQL code

case when col = 0 then 1 else col end

作者: AcHerat   发布时间: 2011-06-15

SQL code
case 字段 when 0 then 1 end

作者: zy112429   发布时间: 2011-06-15

SQL code
select case col when 0 then 1 else col end as col from 
(
  select 0 as col union all select 1
) as t

作者: aspwebchh   发布时间: 2011-06-15