mySQL converting lat/lon to spatial

INSERT INTO myTable (coordinates)
SELECT GeomFromText(CONCAT('POINT(',ot.latitude, ' ', ot.longitude,')'))
FROM otherTable ot;

or

UPDATE myTable
SET coordinates = GeomFromText(CONCAT('POINT(',latitude, ' ', longitude,')'));

MySQL find first, last row

SELECT
this,
query,
SUBSTRING_INDEX(GROUP_CONCAT(CAST(rocks AS CHAR) ORDER BY _date), ',', 1 ) as top,
SUBSTRING_INDEX(GROUP_CONCAT(CAST(rocks AS CHAR) ORDER BY _date DESC), ',', 1 ) as bottom

FROM database

Back to Top