在DB2中需要更新一个表,更新的方式是从某个表中获取数据插入,然后再从其他表中获取其他字段来更新其他字段,如下:比如 insert A(a1,aa2,a3) from select b1,b2,b3 from B; update A(a4,a5) select c1,c2 from C where a1 = C.c3 ...
显示全部在DB2中需要更新一个表,更新的方式是从某个表中获取数据插入,然后再从其他表中获取其他字段来更新其他字段,如下:
比如 insert A(a1,aa2,a3) from select b1,b2,b3 from B;
update A(a4,a5) select c1,c2 from C where a1 = C.c3
update A(a6,a7)select d1,d2 from D where a1 = D.c3
update A(a8,a9)select e1,e2 from E where a1 = E.e3
怎样做效率更好?用上述的方法效率很慢,请帮助给分析一下,谢谢!
收起