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: Problem updating latest value (date) column for a given key

Re: Problem updating latest value (date) column for a given key

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 1 Aug 2002 23:03:47 +0200
Message-ID: <ukj9bq5orhhk2b@corp.supernews.com>

"Dave Siddons" <davesiddons_at_lineone.net> wrote in message news:3d498b2b$1_1_at_mk-nntp-1.news.uk.worldonline.com...
> PS : No it aint Homework and I do have a single piece of SQL that does it
> but it takes hours....
>
> Along the lines of
>
> update emp e1
> set e1.end_date = ...
> where (e1.id, e1.end_date) in
> (select id, max(end_date) from emp where id = e1.id group by id);
>
> or something along those lines..
>
>
> Come on sybrand.... I ain't no schoolkid, I need this to run fast.
>
> I've been tryng to come with a way in PL/SQL that would utilise one full
> table scan (as a cursor and do the updates through that.)
>
> Possibly identify the correct row (highest end_date for each id), store
the
> rowid and then apply the change via that. Worried about rollback
> requirements though.
>
> Keep on thinkin ...........
>

Looks like you didn't read my solution.
It will work. If you don't believe it: your problem

--
Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address
Received on Thu Aug 01 2002 - 16:03:47 CDT

Original text of this message

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