0

I've using POINT data type (mysql 5.7) , I want to search points given radious.

This is my table:

CREATE TABLE `points` (
  `id` int(10) NOT NULL,
  `name` varchar(45) ,
  `location` point,
  PRIMARY KEY (`id`),
) 

I've used following sql.

SELECT id,X(location),Y(location),
ST_Distance_Sphere(point(30.714006, 76.853478),location)/1000 AS distance 
FROM points HAVING distance < 100; 

But the distance return by this statement is very less then actual

Thanks in advance!

Govind Samrow
  • 9,981
  • 13
  • 53
  • 90
  • Possible duplicate of http://stackoverflow.com/questions/21168380/use-mysql-spatial-extensions-to-select-points-inside-circle – Mark Baker Aug 24 '16 at 11:49
  • No, I've using POINT datatype so I haven't found any relevant answer. – Govind Samrow Aug 24 '16 at 11:54
  • So doesn't the answer by `Andrew - OpenGeoCode` in that possible duplicate that I linked use POINT datatype? – Mark Baker Aug 24 '16 at 11:58
  • 1
    Possible duplicate of [Whats the fastest way to lookup big tables for points within radius MySQL (latitude longitude)](http://stackoverflow.com/questions/38548473/whats-the-fastest-way-to-lookup-big-tables-for-points-within-radius-mysql-latit) – e4c5 Aug 24 '16 at 12:08

0 Answers0