Issues in correlated update statement

I have to derive a value from the existing column and then update that derived value in another column. I'm using below query and its not working.

UPDATE FACT_TABLE F1
SET    F1.EOD_IND  = (SELECT DECODE(DENSE_RANK() OVER (PARTITION BY
F1.RATING_DIM_ID ORDER BY F1.EVENT_DT DESC), 1, 'Y', 'N') EOD_IND
                   FROM  FACT_TABLE F2
                   WHERE F1.ROWID = F2.ROWID
                   AND   F1.EVENT_DT = F2.EVENT_DT  
                   )                                    
WHERE  EXISTS (SELECT 1
                   FROM  FACT_TABLE F2
                   WHERE F1.ROWID = F2.ROWID
                   AND   F1.EVENT_DT = F2.EVENT_DT  
                   )  


This query is updating the FACT_TABLE with the last derived value. So i think the correlation is the issue but not sure how to fix this.

Please check this query and provide your suggestion.

Thanks for the help.
Mercury66Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
I don't now your tables or data but when I see an update like this, I think MERGE:
http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_9016.htm#SQLRF01606

There are examples in the docs and everywhere online.

If you want a copy/paste answer, please provide sample tables, data and expected results so we can set up our on test case.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mercury66Author Commented:
Thanks a lot for providing the solution.  After posting this query,  I tried MERGE statement and it worked.  But not sure if there is any better way to join and do the correlated update.
slightwv (䄆 Netminder) Commented:
Glad to help.

From my experience MERGE is pretty efficient and a lot less confusing than a correlated update.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.