方法一:
最好的办法是将float字段改为decimal。
方法二:
使用binary关键字解决。具体操作为“select sum(binary 字段名(float类型))”
方法三:Cast。
Cast(字段名 as 转换的类型 ),例如
select type,CAST(sum(item_value) as DECIMAL(19,5)) from tb_config GROUP BY type
方法四:使用round保留几位小数
如 round(201.42999449372,2)