update a set val = (select b.val from A a,B b where a.key=b.key )
update a set val = (select b.val from A a,B b where a.key=b.key )
update a set val = (select b.val from A a,B b where a.key=b.key )
刚看错了 试试这个 update A a set a.val = (select val from B where key=a.key )
lz有oracle PL/SQL的书吗? 怀疑!!!
update table1 a set a2=(select a.b2 from table1 a,table2 b where a.a1=b.b1) where a1=(select a.a1 from table1 a,table2 b where a.a1=b.b1)
update A a set a.val = (select val from B where key=a.key ) 正解update table1 a set a2=(select a.b2 from table1 a,table2 b where a.a1=b.b1) where a1=(select a.a1 from table1 a,table2 b where a.a1=b.b1) 这种方法自找麻烦。
试试这个 update A a set a.val = (select val from B where key=a.key )
set a2=(select a.b2 from table1 a,table2 b where a.a1=b.b1)
where a1=(select a.a1 from table1 a,table2 b where a.a1=b.b1)
set a2=(select a.b2 from table1 a,table2 b where a.a1=b.b1)
where a1=(select a.a1 from table1 a,table2 b where a.a1=b.b1) 这种方法自找麻烦。