Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: update

Re: update

From: Joel Giraud <joel.giraud_at_chu-bordeaux.fr>
Date: Mon, 10 Dec 2001 17:55:11 +0100
Message-ID: <9v2pdg$9hr$1@news.u-bordeaux.fr>

"Francesco Zavatarelli" <fzavat_at_tiscalinet.it> a écrit dans le message news: 9v2kd6$itf$1_at_pegasus.tiscalinet.it...
> I have this table:
>
> code value
> 1 1000
> 1 2000
> 1 3000
> 2 1000
> 2 5000
> ... ...
>
> I want to set value to max(value) inside a GROUP
> i.e I want to get this:
>
> code value
> 1 3000 (changed from 1000 to 3000)
> 1 3000 (changed from 2000 to 3000)
> 1 3000
> 2 5000 (changed from 1000 to 5000)
> 2 5000
> ... ...
>
> which is the UPDATE statemet I have to use?
> thanks
> FZ
>
>
>

You can try this :
update toto a set value = (select max(value) from toto b where b.code = a.code); Received on Mon Dec 10 2001 - 10:55:11 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US