日期:2014-05-17 浏览次数:21231 次
update t_inf_tmp tmp
set tmp.tmp_ua_date =
(select max(to_char(his.insertdate, 'yyyymmddhh24miss') ||
rpad(his.useragent, 50, ' '))
from history_table his
where his.isdn = tmp.isdn
and his.insertdate < tmp.insertdate);
merge into t_inf_tmp t1
using (select tmp.rowid rid,
max(to_char(his.insertdate, 'yyyymmddhh24miss')
------解决方案--------------------
rpad(his.useragent, 50, ' ')) str
from history_table his, t_inf_tmp tmp
where his.isdn = tmp.isdn
and his.insertdate < tmp.insertdate
group by tmp.rowid) t2
on (t1.rowid = t2.rid)
when matched then
update set t1.tmp_ua_date = t2.str;