select case char(DivisionLineValue)
when '0999999999.00 '
then StandByTwo
else char(DivisionLineValue)
end from RIDivisionLineDef
查出来的数据是
0000400000.00
0000600000.00
MaxLimit
DivisionLineValue 是 decimal 类型 StandByTwo 是 varchar类型
现在想要做的 是让 查出来的结果是
400000.00
600000.00
MaxLimit
改 怎么写 求高手解答
------解决方案--------------------------------------------------------
- SQL code
select replace(replace(replace(replace(replace(DivisionLineValue, 'begin', ''), 'begin0', ''), 'begin00', ''), 'begin000', ''), 'begin0000', '')from ( select 'begin' || case char(DivisionLineValue) when '0999999999.00 ' then StandByTwo else char(DivisionLineValue) end as DivisionLineValue from RIDivisionLineDef ) as A