oracle生成path的sql语句
UPDATE "table" t1
SET t1. PATH = (
SELECT
‘/-1‘ || SYS_CONNECT_BY_PATH (id, ‘/‘) PATH
FROM
"table" t2
WHERE
t2.id= t1.id
START WITH pid= ‘-1‘ CONNECT BY PRIOR id= pid
);
生成path
select id, pid, ‘/-1‘ || sys_connect_by_path(id, ‘/‘) path
from "table"
START WITH pid=‘-1‘
CONNECT BY PRIOR id= pid