Shally @ 2004-11-05 12:54
update test a
set (a.prdn_st,avg_yield)=(select b.prd_st,b.avg_yield
from test11 b
where a.prd_no=b.prd_no and a.plant=b.plant )
但是需要注意的是必须要一对一,否则oracle会报错:
ORA-01427: single-row subquery returns more
than one row. Cause: You tried to execute an SQL statement that contained a subquery
that returns more than one row.
用cursor update语句如下:
update bes_bonus set facility=rec.facility,site=rec.site where beslot=rec.beslot and bonustmst=rec.bonustmst;
set (a.prdn_st,avg_yield)=(select b.prd_st,b.avg_yield
from test11 b
where a.prd_no=b.prd_no and a.plant=b.plant )
但是需要注意的是必须要一对一,否则oracle会报错:
ORA-01427: single-row subquery returns more
than one row. Cause: You tried to execute an SQL statement that contained a subquery
that returns more than one row.
用cursor update语句如下:
update bes_bonus set facility=rec.facility,site=rec.site where beslot=rec.beslot and bonustmst=rec.bonustmst;
浙公网安备 33010602011771号