计算出距离并根据距离从近到远排序,距离单位为米.
SELECT *,
ST_Distance_Sphere(POINT(longitude, latitude), POINT(112.2524642944336, 30.325886143162684)) AS distance
FROM shop_shop
ORDER BY distance;
转载请注明:莫晓寒 » Mysql5.7实现附近的人或者店铺的方法
计算出距离并根据距离从近到远排序,距离单位为米.
SELECT *,
ST_Distance_Sphere(POINT(longitude, latitude), POINT(112.2524642944336, 30.325886143162684)) AS distance
FROM shop_shop
ORDER BY distance;
转载请注明:莫晓寒 » Mysql5.7实现附近的人或者店铺的方法