|
-
Sorry Jeff, but that one won't work. Y is un-defined at the outer level - I simply couldn't resist pointing out your mistake - you make so dang few of them .
But now that I've done that, I suppose I should give dba_admin some help .
Okay, here are some options - you will probably want to test each one and get the stats - each solution is applicable under different circumstances:
I've changed the table and column names to stuff from my database, and I'm feeling too lazy to change them back and format the statments, so you'll have to do that yourself 
update org x
set org_dba_nm = (select org_dba_nm from org y where y.org_pk=x.org_pk)
where exists (select 1 from org y where y.org_pk=x.org_pk)
update
(select x.org_pk, x.org_dba_nm, y.org_dba_nm as nm2
from org x, org y
where
y.org_pk=x.org_pk)
set
org_dba_nm = nm2
update org x
set org_dba_nm = (select nvl(y.org_dba_nm, x.org_dba_nm) from org y where y.org_pk(+)=x.org_pk)
...together with your original solution gives you a total of 4 different solutions to the same problem. Each has its own usefulness based on such things as table size, indexes, etc.
HTH,
- Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|