select case when data.windd in ( '/////', ',,,,,', '-----', '999.9', '',
'null', 'NULL', null ) then ''
when data.windd='' then ''
else convert(decimal(10, 1), data.windd) end windd
from table1
我的本意是如果这个 data.windd 这个字段值是 '/////', ',,,,,', '-----', '999.9', '',
'null', 'NULL', null 其中的一个的话 返回''空字符串,如果不是这几个特殊字符的话转换为数字,现在 一直报 从数据类型 varchar 转换为 numeric 时出错,好像是else语句不管是否满足else条件一直在判断是否能转换。
问怎么写sql能达到我的要求