查看“︁MySQL/POINT”︁的源代码
来自康健生活
←
MySQL/POINT
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 测试数据 == <div class="pageBoxGreen">mysql{{Version|8.0+}} 之后的版本,空间数据类型的操作函数在命名上统一在前面加上<code>ST</code>,如 <code>GeomFromText</code> 改为 <code>ST_GeomFromText</code>。</div> 创建测试表和字段。 {{leftrightflex|<syntaxhighlight lang="mysql"> CREATE TABLE `test-location` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '序号', `location` point NOT NULL COMMENT '经纬度', `text` varchar(50) DEFAULT NULL COMMENT '描述', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4;</syntaxhighlight>|{{consoleout|<pre> Query OK, 0 rows affected (0.08 sec) </pre>}}}} {{leftrightflex|<syntaxhighlight lang="mysql"> INSERT INTO `test-location` (location, text) VALUES (ST_GeomFromText('POINT(100 200)'), '测试点1'), (ST_GeomFromText('POINT(300 500)'), '测试点2');</syntaxhighlight>|{{consoleout|<pre> Query OK, 2 rows affected (0.02 sec) Records: 2 Duplicates: 0 Warnings: 0 </pre>}}}} 添加数据还可以使用其他语句。 <syntaxhighlight lang="mysql"> SET @tempdata = 'POINT(100 100)'; INSERT INTO `test-location`(location, text) VALUES ( ST_GeomFromText(@tempdata), '测试点3' ); /** or **/ SET @tempdata = ST_GeomFromText('POINT(100 100)'); INSERT INTO `test-location`(location, text) VALUES ( @tempdata, '测试点4' ); </syntaxhighlight> == 函数 == === ST_GeomFromText === === ST_PointFromText ===
此页面嵌入的页面:
模板:Consoleout
(
查看源代码
)
模板:Double-columns
(
查看源代码
)
模板:Double-columns/style.css
(
查看源代码
)
模板:Version
(
查看源代码
)
模板:Version/style.css
(
查看源代码
)
返回
MySQL/POINT
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。