Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Processing Groups
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