我想將150.1835024
和32.8392648
這樣的東西插入到MySQL中,作爲float
。問題是當我嘗試創建一個像FLOAT 3,7
這樣的mySQL字段時,它不起作用。什麼是適當的格式?如何正確地將緯度和經度座標插入到mySQL float中?
這是我的錯誤:
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').
http://stackoverflow.com/questions/39612856/create-mysql-spatial-column-point-data-type-with-lat-long-without-using-alter/39613104#39613104 – e4c5
7位小數就夠了區分一隻螞蟻。 (矯枉過正) –