2015-04-21 235 views
2

如何设置点列的默认值在MySQL表设置默认值

我试图

`location` POINT NULL DEFAULT POINT(7.0, 81.0), 

而是给出了一个错误

ERROR: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POINT(7.0, 81.0),

如何设置默认值到点列

回答

2

类型为POINT的列不能有默认值。如果您运行create table x(位置POINT not null DEFAULT 7.0, 81.0),你会看到消息

BLOB/TEXT column 'location' can't have a default value

你可以参考this page

+0

感谢reply.Is那里this.I任何参考

发现 HTTP:// WWW .informit.com/articles/article.aspx?p = 1238838&seqNum = 2 写于2008 – user2473015

+2

@ user2473015查看我的更新回答 – Jens

+0

感谢朋友的更新 – user2473015