where exists(select 1 from b where b.id=a.id); 为什么还要加它呢?请执教?
写plsql. declare curcor c_1 is select a.id, b.vb from a, b where a.id=b.id; begin for r_c1 in c_1 loop update a set va=r_c1.vb where id=r_c1.id; commit; end loop; end;
对了,大哥,为什么还要加这句where where exists(select 1 from b where b.id=a.id);
update (select a.va as va1,b.va as va2 from a,b where a.id=b.id) set va1=va2
update a set va=(select max(vb) from b where b.id=a.id) where exists(select 1 from b where b.id=a.id);
为什么还要加它呢?请执教?
declare
curcor c_1 is
select a.id, b.vb from a, b where a.id=b.id;
begin
for r_c1 in c_1 loop
update a set va=r_c1.vb where id=r_c1.id;
commit;
end loop;
end;
where exists(select 1 from b where b.id=a.id);
where exists(select 1 from b where b.id=a.id);