Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Help with update query

Re: Help with update query

From: Scott Powell <powels10_at_nationwide.com>
Date: 23 Sep 2004 14:28:34 -0700
Message-ID: <94a6b39a.0409231328.5b0023a3@posting.google.com>


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

Original text of this message

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