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 -> Re: Processing Groups

Re: Processing Groups

From: Dmitry E. Loginov <dmitry_loginov_at_mtu.ru>
Date: Tue, 11 Dec 2001 23:21:17 +0300
Message-ID: <9v5r3t$2pjc$2@gavrilo.mtu.ru>


update your_table set Y=X
where rowid in (select min(rowid) from your_table group by keyvar);

"Lindsay Walton" <lwalton_at_union-investment.de> wrote in message news:6970fcdb.0112110146.64b22d28_at_posting.google.com...
> Essentially I have a table like this:
>
> KEYVAR X Y
> ====== = =
> A 1 .
> A 1 .
> B 1 .
> C 1 .
> C 1 .
> C 1 .
>
> and want to make Y equal 1 on the first occurance of the a new KEYVAR
group
> ie like:
>
> KEYVAR X Y
> ====== = =
> A 1 1
> A 1 .
> B 1 1
> C 1 1
> C 1 .
> C 1 .
>
> How can I do this using SQL?
>
> Regards
> Lindsay Walton
Received on Tue Dec 11 2001 - 14:21:17 CST

Original text of this message

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