Find the distance between two points in MYSQL. (using the Point Datatype)

后端 未结 3 1112
孤街浪徒
孤街浪徒 2021-01-05 07:39

Suppose I have a 2 column table like this:

| user_id      | int(11) | NO   | UNI | NULL    |                |
| utm          | point   | NO   | MUL | NULL            


        
3条回答
  •  梦毁少年i
    2021-01-05 08:14

    You can also do it this way. Not sure if it's faster or not.

    select * from mytable where glength(geomfromtext(concat('linestring(', x(utm), ' ', y(utm), ',20 20', ')'))) < 99999999
    

提交回复
热议问题