I have two tables:
OrdHead: Order_no, CustOrd
OrdItem: Item, Order_no, CustOrd
Both the tables are joined using Order_No which is Alphanumeric.. I need to to update CustOrd (NUMBER) column of OrdItem with the same CustOrd number in OrdHead table using Order_no.
What is the best way to do that ? Do I add any index to the tables?
Currently I do it with the following query, but its taking alot of time just with 100,000 records.
UPDATE ORDITEM A SET CUSTORD =
(SELECT CUSTORD FROM ORDHEAD b WHERE b.ORDER_NO = a.ORDER_NO);