Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How can I do it optimally ?
luba_at_usb wrote:
>
> Alex Filonov <afilonov_at_pro-ns.net> ÓÃÃÂÃÉÌ × ÃŽÃ×ÃÓÔÑÈ
> ÓÌÅÄÕÀÃÃ…Ã…:94g7qt$j8k$1_at_nnrp1.deja.com...
> > In article <949c74$1ng$1_at_news.ukrsotsbank.com>,
> > "luba_at_usb" <luba_at_usb.ua> wrote:
> > > How can I do it optimally ?
> > > update Tab1
> > > set Tab1.field2=(
> > > select sum (decode (field1,1,field2,0)+decode
(field1,2,field3,0))
> > > from Tab1 where field1 in (1,2))
> > > where field1=1 ;
> > >
> >
> > Looks like it is optimal. Is it working too long?
> >
> It is working not long , but mayby you can do it another ?
It may be possible to update a join directly - check your doco for the prerequesites. Look for 'key preserved' views
HTH
-- =========================================== Connor McDonald http://www.oracledba.co.uk (mirrored at http://www.oradba.freeserve.co.uk) "Some days you're the pigeon, some days you're the statue"Received on Mon Jan 22 2001 - 05:25:16 CST