* 인포믹스 DB를 사용중입니다. 아래처럼 했는데 자꾸 문법에러가 나네요.
update tb_cr_quar_tar_prsn original
set staff_no = (select max(b.staff_no)
from outer tb_ci_staff b
where original.appr_no = b.appr_no
and original.resd_reg_no = b.resd_reg_no
and trim(original.staff_nm) = trim(b.staff_nm)
and b.staff_no = (select max(staff_no)
from tb_ci_staff
where resd_reg_no = original.resd_reg_no)
)
where original.manage_no in (select temptab.manage_no
from TABLE (MULTISET(select a.appr_no as appr_no
, a.manage_no as manage_no
, b.staff_no as staff_no
from tb_cr_quar_tar_prsn a, outer tb_ci_staff b
where a.appr_no = b.appr_no
and a.resd_reg_no = b.resd_reg_no
and trim(a.staff_nm) = trim(b.staff_nm)
and b.staff_no = (select max(staff_no)
from tb_ci_staff
where resd_reg_no = a.resd_reg_no)
)
) temptab
)
|