标签:
/*根据半径(1000米)选择记录 */
SELECT * FROM pointlocation where earth_box(ll_to_earth(40.057031,116.307852),4000) @> ll_to_earth(pointlocation.lat, pointlocation.lon);
/*判两点间的距离*/
SELECT earth_distance(ll_to_earth(40.057031,116.307852), ll_to_earth(pointlocation.lat, pointlocation.lon)) FROM pointlocation where id=1112
标签:
原文地址:http://www.cnblogs.com/viewcozy/p/4795018.html