| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: how do I rewrite this query optimized
OK, try this:
update re
set paid =
(select re.paid
+ decode(p.rtype,'xx', (-1 * pt.amt)
,'yy', (-1 * pt.amt),pt.amt)
from p, pt
where p.pk1col1 = re.fk1col1
and p.pk1col2 = re.fk1col2
and pt.fk1col1 = re.pk1col1
and pt.fk1col2 = re.pk1col2)
where p.pk1col1 = re.fk1col1
and p.pk1col2 = re.fk1col2
and pt.fk1col1 = re.pk1col1
and pt.fk1col2 = re.pk1col2);
-- Posted via http://dbforums.comReceived on Tue Jul 22 2003 - 09:50:52 CDT
![]() |
![]() |