I use oracle 10.
I have update statement like that :
update table1 t1
set v_value=(select v_value
from table2 t2
where t2.user_id=t1.user_id
and t2.item_id=t1.item_id )
It works but takes too much time. How can I optimize it ?
You can try a merge statement:
(you might need to check the syntax, there were same changes to which parts in a MERGE are mandatory and which not between 10 and 11 – haven’t used 10g for a long time)