update嵌套两个select update t_inf_tmp tmp set (orignal_useragent, orignal_date)=
(
select useragent, insertdate from(
select useragent, insertdate
from v_his_all his
where his.isdn=tmp.isdn
and his.insertdate<tmp.insertdate
order by his.insertdate desc
)
where rownum<=1
);
update t_inf_tmp tmp set (orignal_useragent, orignal_date)=(
select useragent, insertdate from(
select useragent, insertdate, rank() over(partition by isdn order by insertdate desc) rk
from v_his_all his1
where his1.isdn=tmp.isdn and his1.insertdate<tmp.insertdate
) his2
where his2.isdn=tmp.isdn and rk<=1
);
update t_inf_tmp tmp set (orignal_useragent, orignal_date)=
(
select useragent, insertdate from(
select useragent, insertdate, rank() over(partition by isdn order by insertdate desc) rk
from v_his_all
where his.isdn=tmp.isdn and his.insertdate<tmp.insertdate
) his
where his.isdn=tmp.isdn and rk<=1
);