Functions for Point Objects: X(pt) and Y(pt).
mysql>
They return the coordinates of the point as a floating-point number:
mysql>
mysql>
mysql> SET @pt = GEOMFROMTEXT('POINT(33.2 99.9)');
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> SELECT X(@pt), Y(@pt);
+--------+--------+
| X(@pt) | Y(@pt) |
+--------+--------+
| 33.2 | 99.9 |
+--------+--------+
1 row in set (0.00 sec)
mysql>
Related examples in the same category