答案 0 :(得分:0)
使用replace()
和cast()
替换逗号并将其转换为十进制
select pulau, cast(replace(populasi,',','') as decimal(16,8)), cast(replace(luas,',','') as decimal(16,8))
from tablename
答案 1 :(得分:0)
您需要从数字中删除.
,并用,
替换.
,然后才能SUM
。尝试这样的事情:
SELECT pulau,
SUM(REPLACE(REPLACE(populasi, '.', ''), ',', '.')) AS populasi,
SUM(REPLACE(REPLACE(luas, '.', ''), ',', '.')) AS luas
FROM yourtable
GROUP BY pulau