내 코드는 다음과 같습니다.
CREATE TABLE tableC AS
(SELECT tableA.*,
ST_Intersection (B.geom, A.geom) as geom2 -- generate geom
FROM tableB, tableA
JOIN tableB
ON ST_Intersects (A.geom, b.geom)
WHERE test.id = 2);
이제 작동하지만 geom과 geom2 두 개의 열이 있습니다! 기하학 열 안에 교차점을 기반으로 한 새 기하학이 있습니다. 그렇다면 geom 열을 제외하고 tableA를 어떻게 선택할 수 있습니까?
모든 열이있는 테이블을 만들고 그 후에 열을 삭제 geom
하고 새 이름을 바꿉니다.
CREATE TABLE tableC AS
SELECT
tableA.*,
ST_Intersection (B.geom, A.geom) as geom2 -- generate geom
FROM
tableA inner JOIN tableB ON ST_Intersects (A.geom, b.geom)
WHERE test.id = 2
;
alter table tableC drop column geom;
alter table tableC rename column geom2 to geom;
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다