答案 0 :(得分:0)
如果我理解你的问题,答案是:在单个查询中不可能这样做,你需要一个pl / sql脚本。
declare
tmp1 number;
tmp2 number;
begin
select rate into tmp1 from yourtable where op_date = to_date (040115,'ddmmrr') and code='cs002';
select rate into tmp2 from yourtable where op_date = to_date (040114,'ddmmrr') and code='cs002';
update tablename set rate=tmp1 where op_date = to_date (040114,'ddmmrr') and code='cs002';
update tablename set rate=tmp2 where op_date = to_date (040115,'ddmmrr') and code='cs002';
commit;
end;
/
请注意,如果费率值对日期和代码
不唯一,则此脚本会出错