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: Updating table with values of prior records

Re: Updating table with values of prior records

From: Robert Wachtel <rwachtel_at_gmx.de>
Date: Mon, 27 Feb 2006 23:45:24 +0100
Message-ID: <46hdogFb9pkkU1@individual.net>


Ok, should have written the last msg earlier... ;-)

It seems that using the analytic function LAST like this

UPDATE SEASONS S
  SET S.SEASON_ID = (SELECT MIN(SEASON_ID) KEEP (DENSE_RANK LAST ORDER BY STARTDATE) FROM SEASONS WHERE STARTDATE < S.STARTDATE AND SEASON_ID IS NOT NULL)
WHERE S.SEASON_ID IS NULL did the trick.

Maybe anyone can confirm this solution?

tia

Robert Received on Mon Feb 27 2006 - 16:45:24 CST

Original text of this message

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