计算距离时命令不同步错误

时间:2018-02-01 18:56:41

标签: mysql phpmyadmin distance latitude-longitude haversine

我正在尝试计算给定Point(lat, long)的距离,但是当我按距离列使用排序时,我得到Commands out of sync; you can't run this command now错误。

这是我的问题:

SELECT id, name, country_code, postal_code, latitude, longitude, 
    st_distance_sphere(
        point(50.77333, 7.185259), 
        point(latitude, longitude)
    ) AS distance 
FROM place_merged WHERE name LIKE ('ko%') ORDER BY distance

如果删除ORDER BY子句,则执行正常。有什么方法可以计算距离并获得距离我提供的latitude & longitude一定距离的地方吗?

1 个答案:

答案 0 :(得分:0)

那是在存储过程中,对吗?你未能DEALLOCATE PREPARE

相关问题