我如何更新 Postgres 中的 table 列?
How do i update a table column in Postgres?
我正在尝试更新我的一个表,但出现语法错误。例如我的查询:
update micros set tabular = select count (b.the_geom) from trees a, streets b where st_contains(b.the_geom,t.the_geom) group by t.roots;
我收到的错误信息是:
错误:"group"
处或附近的语法错误
自然而然的做法是:
update micros
set tabular = st_contains(b.the_geom, t.the_geom)::int
from trees a, streets b;
也就是说,逻辑不通。看起来你会想要 some 三个表之间的连接条件。
我正在尝试更新我的一个表,但出现语法错误。例如我的查询:
update micros set tabular = select count (b.the_geom) from trees a, streets b where st_contains(b.the_geom,t.the_geom) group by t.roots;
我收到的错误信息是:
错误:"group"
处或附近的语法错误自然而然的做法是:
update micros
set tabular = st_contains(b.the_geom, t.the_geom)::int
from trees a, streets b;
也就是说,逻辑不通。看起来你会想要 some 三个表之间的连接条件。