//테이블 2개 조인 쿼리.
create table a_table
(
seq int identity(1,1),
col1 varchar(10),
remk varchar(10)
)
create table b_table
(
seq int identity(1,1),
col1 varchar(10),
remk varchar(10),
flag varchar(10)
)
insert a_table values('A','eee'),('B','eee'),('C','eee'),('D','eee'),('E','eee')
insert b_table values('D','12345','A'),('E','4444','A'),('E','55555','B'),('F','345','A'),('H','12345','A')
select * from a_table
select * from b_table
begin tran
update t1
set remk = case t2.flag when 'A' then t2.remk when 'B' then '' end output inserted.*, deleted.*
from a_table t1
inner join b_table t2
on t1.col1 = t2.col1
rollback tran