I have created a table with a FLOAT
type column. However, I found that when I query the column's MAX
, MIN
, AVG
values I get inaccurate numbers, where the returned value is larger than what is actually stored in the table. For example, this is the actual maximum number in the table: 0.00348675. Somehow, MAX
returns this: 0.0034867459908127785
The inaccuracy turned to be due to choosing FLOAT
as type. For this reason, I want to change the columns type to DECIMAL.
I use mysql-workbench
in Ubuntu 18. When I right-click the table and choose Alter Table
I can change the data types. Unfortunately, when I change the concerned field from FLOAT
to DECIMAL
, FLOAT
returns again automatically. The workbench can not choose DECIMAL
for some reason. See this picture. I can choose DECIMAL from a list. Then when I move the mouse elsewhere to click on the next empty row, so I can click Apply
, the DECIMAL
disappear and FLOAT
returns again:
Can anyone advise me what is the reason for the prolem? how to overcome the issue?