< 서브 쿼리(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);

+ Recent posts