프로그래밍/DB

postgreSQL 사용법 - 테이블 업데이트

kugancity 2019. 9. 28. 16:09
반응형




postgresql 테이블 업데이트 방법 


( how to update postgresql table ) 





다른 테이블 필드 값으로 업데이트 




update table2 as f set field1 = h.field1 from  table1 as h where f.field2 = 2 and f.id = h.id;



같은 테이블 필드를 분리해서 업데이트 




update 테이블이름 set 본번 = split_part(지번, '-',1);



특정 값으로 전체 필드 업데이트 



update 테이블이름 set 칼럼이름='문자열' 









728x90
반응형