【发布时间】:2019-03-31 18:02:18
【问题描述】:
我正在尝试在我的桌子上运行它
select ST_Distance (
select location from utenti where user_id=464,
select location from utenti where user_id=474604
);
有一个这种类型的位置列location geography(POINT, 4326)
我遇到语法错误,但我不明白为什么。
我怎样才能实现我的目标?
例如,如果我在两个查询中为每个用户选择该列,我会得到这样的数据 "0101000020E61000001435F98F528125402AE5B512BAA34540"
并运行:
select ST_Distance(%s, %s);
它有效,但距离似乎不正确。嗯
【问题讨论】:
-
您必须将子查询括在括号中。
-
你可以测试这个查询:
SELECT ST_Distance(a.geom, b.geom) FROM utenti a, utenti b WHERE a.user_id=464 AND b.user_id=474604;
标签: postgresql gis postgis