UPDATE p#BIM_INC_EXP_SORT a
SET (a.parentid, a.levelno, a.isleaf) =
(SELECT b.parentid, b.levelno, b.isleaf
FROM (select unqguid,
(select max(unqguid)
from p#BIM_INC_EXP_SORT
where code = substr(t.code, 1, len(t.code) - 2)) parentid,
LEVEL levelno,
connect_by_isleaf isLeaf
from p#BIM_INC_EXP_SORT t
start with len(code) = 3
connect by prior code = substr(code, 1, len(code) - 2)) b
WHERE a.unqguid = b.unqguid)
WHERE 1 = 1

posted on 2020-05-09 10:57  ..SunXin  阅读(285)  评论(0编辑  收藏  举报