--更新高价件表中的型号, hm_material h1
update hm_highrate_material h
set h.material_model = (select h1.model from hm_material h1
where h.material_id = h1.material_id);
--对表A的a2,a3进行更新(带条件);
update A
set (A.a2, A.a3) =
(select B.b2, b.b3
from B
where B.b1 = A.a1 and A.a3 = 100)
where exists (select 'X'
from B
where B.b1 = A.a1 and A.a3 = 100);
--或者:
update A
set (A.a2, A.a3) =
(select B.b2, b.b3
from B
where B.b1 = A.a1 and A.a3 = 100)
where A.a1 in (select B.b1
from B
where B.b1 = A.a1 and A.a3 = 100);
update t1
set t1.c2 = t2.c2
from t2
where t1.c1 = t2.c1
oracle update
于 2021-04-28 21:58:39 首次发布