У меня есть запрос в Oracle, чтобы выбрать полигоны из my_polygon_table
, которые взаимодействуют или находятся внутри одного многоугольника, находящегося в border_table
:
Select t1.*, t2.*, sdo_geom.sdo_intersection(t1.geoloc, t2.geom, 2 ) as genericgeo From table
( sdo_join ('my_border_table', 'geoloc', 'my_polygon_table', 'geom', 'mask=ANYINTERACT' ) ) j,
my_border_table t1,my_polygon_table t2
Where
(j.rowId1 = t1.rowId and j.rowId2 = t2.rowId) and (t1.geoloc.sdo_gtype = 2003 or t1.geoloc.sdo_gtype = 2007) and (t2.geom.sdo_gtype = 2003 or t2.geom.sdo_gtype = 2007)
До сих пор я установил геометрию с CREATE EXTENSION postgis;
и скопированные таблицы.Когда я запускаю запрос в pgAdmin, я получаю
ERROR: syntax error at or near "table"
LINE 2: ...ntersection(t1.geoloc, t2.geom, 2 ) as genericgeo From table
^
SQL state: 42601
Character: 129
Как сделать то же самое с PostgreSQL?