Get distance If database table from geometry filed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// SELECT *, 100*(GLength( LineStringFromWKB( LineString( location_filed, GeomFromText('POINT(21.217410 72.866509)') ) ) )) AS distance FROM location_table |
1 2 3 4 5 6 7 |
// SELECT *, 100*(GLength( LineStringFromWKB( LineString( location_filed_1, location_filed_2) ) )) AS distance FROM test |
More Stories
How to reset or change the MySQL root password?
Incorrect datetime value: ‘0000-00-00 00:00:00’ for column
MySQL String Functions