我需要删除或替换(%)字符串和thyen末尾的多余字符,以将字符串转换为十进制,因为我需要获取名为和的2个字段的 总和discount1``discount2
(%)
discount1``discount2
我尝试的最后一个组合是:
replace ((p16.pa_value,'%','')CAST (p16.pa_value AS DECIMAL (3,0))) as discount2,
这似乎是超错误的,因为语句CAST内部replace
CAST
replace
试试这个:
CAST (replace (p16.pa_value,'%','') AS DECIMAL (3,0)) as discount2