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

Home -> Community -> Usenet -> c.d.o.misc -> I need help with an SQL Update query...

I need help with an SQL Update query...

From: Joe <RappaJ_at_nycha.nyc.gov>
Date: 9 Oct 2002 13:31:45 -0700
Message-ID: <ab8e8633.0210091231.570c1853@posting.google.com>


Hi,

Lets say that I had a table called TABLEA with 2 columns called ID and MY_VALUES as shown in the sample below.

ID MY_VALUES
== =========

AA 100
AA 100
AA 100
AA 100
AA 100
BB 222
BB 222
BB 222
BB 222
CC 999
CC 999
CC 999
DD 100
DD 100
DD 100

Is there a simple SQL update command that I can use to have the output look like this below? Basically,I want to keep the first value of MY_VALUES, and zero out the rest for that ID.

ID MY_VALUES
== =========

AA 100
AA 0
AA 0
AA 0
AA 0
BB 222
BB 0
BB 0
BB 0
CC 999
CC 0
CC 0
DD 100
DD 0
DD 0

Thanks,
Stumped Received on Wed Oct 09 2002 - 15:31:45 CDT

Original text of this message

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