我有一个需要清理的数字列表,而我使用的代码似乎不起作用。
数字预操作示例:0000000001C 数字应该如何:0.13 数字预操作示例:0000000173A 数字应该如何:17.31
我一直在处理的代码有点令人困惑:
select amount,
case when right(amount,1) = 'A' then concat(right(amount, charindex('0', reverse(amount))-1), replace(amount,'A','1'))
when right(amount,1) = 'C' then concat(right(amount, charindex('3', reverse(amount))-1), replace(amount,'C','3')) end
from db
我能得到的数字是 1C00000000013, 173A00000001731
任何帮助表示赞赏!