2014年2月17日星期一

update 子查询隐含风险

update examinees s
   set (s.birthdate,
        s.issuecertdate,
        s.acceptgradedate,
        s.lastmodifieddate) = 
(select  to_char(t.birthdate, 'yyyy/mm/dd'),
        to_char(t.issuecertdate, 'yyyy/mm/dd'),
        to_char(t.acceptgradedate, 'yyyy/mm/dd'),
        to_char(t.lastmodifieddate, 'yyyy/mm/dd') from examinees_impto_zt t where
         s.examineeid = to_char(t.examineeid))
 where exists(select 1 from examinees_impto_zt b where s.examineeid = to_char(b.examineeid));

没有评论:

发表评论