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