insert into sm_funtouser_tb
( user_id, group_code, field_id, authority)
select a.user_id, c.group_code, c.field_id, c.authority
from sm_users_tb a, sm_deggroup_tb b, sm_funcgroup_tb c
where a.user_degree = b.user_degree
and b.group_code = c.group_code
and c.group_code = '01'
위의 insert문을 update문으로 변환하면 어떻게 해야져??
Update sm_funtouser_tb Dset
D.authority = (select c.authority
from sm_users_tb a,
sm_deggroup_tb b,
sm_funcgroup_tb c
where a.user_degree = b.user_degree
and b.group_code = c.group_code
and c.group_code = '01'
AND D.user_id = a.user_id
AND D.group_code = c.group_code
AND D.field_id = c.field_id)
WHERE EXISTS (select *
from sm_users_tb a,
sm_deggroup_tb b,
sm_funcgroup_tb c
where a.user_degree = b.user_degree
and b.group_code = c.group_code
and c.group_code = '01'
AND D.user_id = a.user_id
AND D.group_code = c.group_code
AND D.field_id = c.field_id)