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: Mahendra C <mahendrac_at_vsnl.com>
Date: Sun, 16 Dec 2001 16:53:50 +0530
Message-ID: <9vj2uh$6q9$1@news.vsnl.net.in>


UPDATE <table>
SET Y = 1
WHERE rowid IN

    (SELECT max(rowid)
    FROM <table>
    GROUP BY keyvar);

Hope this works
Regards
Mahendra

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 Sun Dec 16 2001 - 05:23:50 CST

Original text of this message

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