MySQL/POINT:修订间差异
来自康健生活
| 第40行: | 第40行: | ||
=== ST_GeomFromText === | === ST_GeomFromText === | ||
=== ST_PointFromText === | === ST_PointFromText === | ||
== 查询数据 == | |||
{{leftrightflex|<syntaxhighlight lang="mysql"> | |||
SELECT | |||
id, | |||
ST_x(location) x, | |||
ST_y(location) y, | |||
location, | |||
text | |||
FROM `test-location`; | |||
</syntaxhighlight>|{{consoleout|<pre> | |||
+----+-----+-----+----------------+------------+ | |||
| id | x | y | location | text | | |||
+----+-----+-----+----------------+------------+ | |||
| 1 | 100 | 200 | POINT(100 200) | 测试点1 | | |||
| 2 | 300 | 500 | POINT(300 500) | 测试点2 | | |||
+----+-----+-----+----------------+------------+ | |||
2 rows in set (0.01 sec) | |||
</pre>}}}} | |||