我如何在 MySQL 中订购此 SELECT 语句?
cursor.execute("SELECT user_id FROM myapp_location WHERE\
GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < %s"\
,(user_utm_easting, user_utm_northing, 500));
此查询选择距离当前用户 500 英尺以内的用户。我如何根据距离对人们进行排序? (g长度)。近的先,最远的最后。
您将如何更改此查询?谢谢。
cursor.execute("SELECT user_id FROM myapp_location WHERE\
GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < %s"\
,(user_utm_easting, user_utm_northing, 500));
This query selects users which are within 500 feet of the current user. How would I order people by the distance? (the glength). Nearby first, farthest last.
How would you change this query? THanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一种方法
Here's one way