请大家分析一下update没有成功
select chkitem,case when max(rate)*2/3 < avg(rate) then avg(rate)
else round(max(rate)*2/3,2)+0.01 end max_rate
from data_quality_rate
where yymm="201006"
group by 1 order by 1
into temp tmp_max_rate;
select chkitem,yymm,case when comcode="43010093" then "4393" else comcode
endcomcode,abs(rate) rate,com_order,0.0000max_rate
from data_quality_rate
where yymm="201006"
into temp t_order;
update t_order set max_rate=(select a.max_rate from tmp_max_rate a
where a.chkitem=t_order.chkitem);
大家可以给我分析一下为什么最后一个update语句没有更新成功么(没有报错)
谢谢了 改成这样看一下
update t_order set max_rate=(select a.max_rate from tmp_max_rate a
where a.chkitem=t_order.chkitem)
where exists ( select * from tmp_max_rate a
where a.chkitem = t_order.chkitem)
页:
[1]