Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: UPDATE... SET... FROM x
Well thank you for the useful feedback.
In case anyone here listens to your trolling, unconstructive comments
(I've checked your history, others who haven't should), the code I
quoted above is mine which I have previously written in t-sql and want
to replicate in Oracle.
I have solved the problem now but perhaps in future you could give me some keywords like nvl() to search for. However I am assuming that you did know the answer to my question - which you probably didn't.
For the benefit of others the code I have used is as follows:
update twr3_01.orapropertymonthlyderived opmd
set (opmd.m32) =
nvl(opmd.m32,
(
select m32
from twr3_01.orapropertymonthlyderived
where opmd.ipdref = ipdref AND opmd.periodendmonth = periodendmonth AND opmd.periodendyear = periodendyear AND opmd.snapshotref = snapshotref AND opmd.datastatetypecode = datastatetypecode AND opmd.sampleref = sampleref AND opmd.periodendfrequency = periodendfrequency ANDm70 = 1