Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-01 13:44:25
Original
1052 people have browsed it

bitsCN.com

 

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

 

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

摘自 hellostory的专栏

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!