Re: self-joined update query, perhaps via subquery
I know this is an old thread but I used this query to make it work on MySQL
UPDATE Tree T
INNER JOIN Tree P
ON (T.ParentNode = P.Node)
SET T.depth = P.Depth + 1 , T.Lineage = CONCAT(P.Lineage, Ltrim(T.ParentNode) , '/')
WHERE P.Depth >= 0
AND P.Lineage Is Not Null
AND T.Depth Is Null;
The only problem is that I didn't know how to make it loop in MySQL.
Subject
Views
Written By
Posted
8452
September 20, 2005 12:41PM
Re: self-joined update query, perhaps via subquery
2960
March 08, 2008 04:00AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.