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!

Help need with Update statement -- Efficient way

user13115886Oct 20 2020 — edited Nov 1 2020

Hi,
COl1 COl2
---- ----
A123 IPX
A123 IPY
A123 IPZ
A123 NULL
B123 IPY
B123 IPZ
B123 NULL
C123 IPZ
C123 NULL

if col2 has IPX, Would like to update all rows with IPX
if col2 has IPY, would like to update all rows with IPY -- A123 IPY is alrdy updated with IPX from the above condition
if col2 has IPZ, would like to update all rows with IPZ -- B123 IPZ is alrdy updated with IPY from the second condition

Best way to write the update statement by keeping all in one single statement, instead of writing three separate update statements.
Please advise.

Thanks

Comments
Post Details
Added on Oct 20 2020
1 comment
111 views