2016-11-08 24 views
0

我想更新我的一个表,但我得到一个语法错误。例如我的查询:我如何更新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; 

我收到的错误消息是:

错误:在语法错误或接近“组”

回答

0

自然的事是:

update micros 
    set tabular = st_contains(b.the_geom, t.the_geom)::int 
    from trees a, streets b; 

也就是说,逻辑没有意义。这似乎是你想要一些加入条件之间的三个表。