select해서 update

승짱·2023년 2월 20일
update tableA set
addr = (select addr from tableB where usr_nm='홍길동')
update tabeA a set
addr = (select addr from tableB where usr_nm = a.usr_nm)
where 
usr_nm in 
(
  select usr_no from tableB 
)

예시

update tableA AS a set
addr = b.addr
from tableB AS b
where
a.usr_no = b.usr_no
profile
Welcome to my memo

0개의 댓글