Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help with update query
Pratap, this is absolutely magic! Entire query took only 13 seconds to
run! I'm not sure how this works yet, but thank you (very much) for
the advice!
Thanks,
Scott
p.s. we are using Oracle 9iR2
pratap_fin_at_rediffmail.com (Pratap) wrote in message news:<830861d2.0409230400.3a1ea0cd_at_posting.google.com>...
> Hi,
>
> Don't know what version you are using, but there is a way in Oracle 9i
> -
>
> merge into calendar c
> using
> (
> select rowid rid,
> rank() over (order by calendar_date) seq
> from calendar
> where business_day = 'Y'
> ) c1
> on
> (
> c.rowid = c1.rid
> )
> when matched then update
> set c.business_day_sequence = c1.seq
> when not matched then -- THIS IS JUST DUMMY, THIS WILL NEVER HAPPEN
> insert ( calendar_date )
> values ( null );
>
> I tried creating a view and then updating a view, but it does not
> allow view update because of the rank function.
>
> Regards,
>
> Pratap
Received on Thu Sep 23 2004 - 16:28:34 CDT
![]() |
![]() |