< 서브 쿼리(Sub Query)-2 >
1) EXIST를 사용해 '있음'으로 갱신하기
update sample1 set b= "있음" where
exists (select * from sample2 where no2 = no);
2) NOT EXISTS를 사용해 '없음'으로 갱신하기
update sample1 set b= '없음' where
not exists (select * from sample2 where no2 = no);
'Geo-Spatial Data Analysis > SQL' 카테고리의 다른 글
[PostgreSQL] PostGIS 공간 INDEX 만들기 (0) | 2023.01.16 |
---|---|
[MySQL] CREATE, DROP, ALTER (0) | 2023.01.13 |
[MySQL] Sub Query(서브 쿼리) - 1 (1) | 2023.01.13 |
[PostgreSQL] join 후 update (0) | 2023.01.12 |
[PostgreSQL] Geometry Column 만들기 (0) | 2023.01.12 |