【发布时间】:2017-02-05 17:19:17
【问题描述】:
我正在尝试将150.1835024 和32.8392648 之类的内容作为float 插入到mySQL 中。问题是当我尝试创建像 FLOAT 3,7 这样的 mySQL 字段时,它不起作用。正确的格式是什么?
这是我得到的错误:
An error occurred when trying to add the field 'location_lat' via
ALTER TABLE `data` ADD `location_lat` FLOAT(3,7)
NULL
DEFAULT NULL
AFTER `fees`
MySQL said: For float(M,D), double(M,D) or decimal(M,D),
M must be >= D (column 'location_lat').
【问题讨论】:
-
7 个小数位足以区分一只蚂蚁和另一只蚂蚁。 (矫枉过正。)
标签: mysql precision sqldatatypes