Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update query optimization

2942624Nov 6 2017 — edited Nov 7 2017

Hello,

This may be a silly question.

I am trying to update ID column of table by taking max(id) from ctrl table.

UPDATE 105_HCA_ACT

SET ID = (select max(ID) from CTRL where E_ID = '105');

This is running for about 10 mins as the no. of records in 105_HCA_ACT are about 1 million.

Is there a better way to do it. Also, I do not have any common columns in these tables.

Thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 5 2017
Added on Nov 6 2017
14 comments
587 views