使用sqlite查询从amout值中删除点(。)

时间:2015-07-06 09:37:37

标签: sql sqlite sum

我想删除金额值中小数位前的点(。)。下面是我的数据库表 enter image description here

查询

SELECT sum( REPLACE( REPLACE( amt, ',', '' ) , ' ', '' ) ) FROM  amt_demo

当我运行上述查询时,我得到以下输出。

输出 enter image description here

但我想要的总和如:

1333.00
100000.50
100000.00
123456789
123456789
123456789
---------------
370571700.50

我知道如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

使用数学CEIL功能

  

SELECT CEIL(sum(REPLACE(REPLACE(',',''),'','&#39 ;)))