Query OK, 1 row affected (0.01 sec) mysql> SELECT ST_Distance((SELECT location FROM test WHERE id=1), (SELECT location FROM test WHERE id=2), 'metre')/1000 AS Km FROM dual; +--------------------+ | Km | +--------------------+ | 1.0219803291719762 | +--------------------+ 1 row in set (0.00 sec) 27
ERROR 3643 (HY000): The SRID of the geometry does not match the SRID of the column 'location'. The SRID of the geometry is 6668, but the SRID of the column is 4326. Consider changing the SRID of the geometry or the SRID property of the column. 28