实际上,我们希望将数据库中的float转换为十进制。当我们检查这些值时,如果一切正确,我们发现mysql round有一个奇怪的行为,我们不知道为什么。
Table name: test
column name: test
column type: float
SQL: SELECT ROUND(test, 2) FROM test
-----------------------------------------
| test | result of round(test,2) |
-----------------------------------------
| 12.225 | 12.23 |
-----------------------------------------
| 12.125 | 12.12 |
-----------------------------------------
答案 0 :(得分:1)