Home >Database >Mysql Tutorial >解决MySQL中float字段SUM()时出现一堆小数的问题

解决MySQL中float字段SUM()时出现一堆小数的问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:07:101453browse

解决MySQL中float字段SUM()时出现一堆小数的问题

方法一:最好的办法是将float字段改为decimal(16,6)。具体方法:可设置一个临时字段,,结合MySQL的关键字binary进行准确复制等。

方法二:使用binary关键字解决。具体操作为“select sum(binary 字段名(float类型))”

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn