williey
Technical User
- Jan 21, 2004
- 242
I need a more efficient way to update 5 columns in table 1 using 5 columns from table 2. But the select criteria requires a 2 tables join between 1 and 2.
Eg.
update A a
set (a.col1, a.col2, a.col3, a.col4, a.col5) =
(select b.col1, b.col2, b.col3, b.col4, b.col5
from B b
where a.col10 = b.col10
and a.col11 = b.col11
and a.col12 = b.col12)
The above method takes too long to update 5 columns with about 40k rows.
Eg.
update A a
set (a.col1, a.col2, a.col3, a.col4, a.col5) =
(select b.col1, b.col2, b.col3, b.col4, b.col5
from B b
where a.col10 = b.col10
and a.col11 = b.col11
and a.col12 = b.col12)
The above method takes too long to update 5 columns with about 40k rows.